Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform requery/refresh problem

Status
Not open for further replies.

bjt52

Technical User
Sep 1, 2004
37
US
Hi,
I have searched the forum and found others have had this problem but I have not been able to find a solution that will work for my situation. I have a database that I have been using for a few years and it is working great. Do to changes in business needs I redesigned the database and I am not having a problem with a subform.
The user uses the subform (datasheet view) to filter records they will be working and then will update the record on the mainform. The problem is after the user updates the information the subform will move to the top record causing them the losing their position; on the previous version of the database I did not have this problem.
I have added the code below to my mainform, but I did not think that it would cause the subform to requery to the top record.
Thank in advance

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.SetWarnings (False)

Dim SQL As String

SQL = "UPDATE MasterData " & _
"SET MasterData.project_name = Forms!frmMain!project_name " & _
"WHERE MasterData.circuitid = Forms!frmMain!circuitid"
DoCmd.RunSQL SQL
DoCmd.SetWarnings (True)

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top