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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating one form from another form

Status
Not open for further replies.

henley12

Programmer
Mar 26, 2004
17
0
0
US
I have a form that performs a DLookup to populate fields on the form based on an Equipment ID. I also have a "search" button next to the Equipment ID field that pulls up the Equipment form to verify or edit that record. If I make a change to the record on the Equipment form, it should update the main form upon closing the Equipment form. I can do a requery of the main form, but it takes me back to the first record. Any ideas?
 
How are ya henley12 . . .

In the [blue]Close[/blue] event of the equipment form:
Code:
[blue]   Dim frm As Form, hldID As Long
   
   Set frm = Forms![purple][b][i]MainformName[/i][/b][/purple]
   hldID = EquipmentID
   frm.Requery
   frm.Recordset.FindFirst "[EquipmentID] = " & ID[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
woops! . . .

Should be:
Code:
[blue]   Dim frm As Form, hldID As Long
   
   Set frm = Forms!MainformName
   hldID = EquipmentID
   frm.Requery
   frm.Recordset.FindFirst "[EquipmentID] = " & [b]hldID[/b][/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top