borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Vb,MySql- insert/import function)Next Topic (MS Access Compact & Repair database option) New Topic New Poll Post Reply
AndreaVB Forum : Database : how to refresh an access DB
Poster Message
seem
Level: Graduate

Registered: 28-11-2005
Posts: 12

icon how to refresh an access DB

hi

i'm using access and i need when i make any change in the database like adding new record that these changes apear in the form without closing the form and reopening it.

thanx in advance

____________________________
Seem Haroun

24-07-2006 at 09:30 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: how to refresh an access DB

Hi,
If you are using Access then the changes are immediately visible. Do you mean that you are storing data in Access and displaying the data in another application such as a windows form written in VB6 .? If that is the case then a lot depends on what data access technology you are using to retrieve the data from the Access database, and what type of Recordest you are reading it into, but in general if you run the "Requery" Command (Recordset.Requery or adodc.Requery etc.) then you will get the changes made to the database.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

24-07-2006 at 11:22 AM
View Profile Send Email to User Show All Posts | Quote Reply
seem
Level: Graduate

Registered: 28-11-2005
Posts: 12
icon Re: how to refresh an access DB

quote:
GeoffS wrote:
Hi,
If you are using Access then the changes are immediately visible. Do you mean that you are storing data in Access and displaying the data in another application such as a windows form written in VB6 .? If that is the case then a lot depends on what data access technology you are using to retrieve the data from the Access database, and what type of Recordest you are reading it into, but in general if you run the "Requery" Command (Recordset.Requery or adodc.Requery etc.) then you will get the changes made to the database.




yes i'm using acess. what i'm doing is that i'm opening a second form from a first 1 and i'm enserting a new record and after i close the second form the new record does not apear in the first form.

____________________________
Seem Haroun
24-07-2006 at 02:43 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: how to refresh an access DB

Hi,
You can put some code in your 2nd. Form to force the first Form to Requery its data and display the latest entry. If you are using the Forms "X" to close it then put the code in the Form_Unload Event, or if you have placed your own "Close" button on the Form then put it in the Button_Click Event prior to the "DoCmd.Close" statement:-

Private Sub CommandClose_Click()
DoCmd.RunCommand acCmdSaveRecord
Form_Form1.Requery
DoCmd.GoToRecord acDataForm, "Form1", acLast
DoCmd.Close acForm, "Form2"
End Sub




[Edited by GeoffS on 25-07-2006 at 08:04 AM GMT]

____________________________
multi-tasking - the ability to hang more than one app. at the same time.

25-07-2006 at 08:03 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : how to refresh an access DB
Previous Topic (Vb,MySql- insert/import function)Next Topic (MS Access Compact & Repair database option) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder