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

Refresh form data based on recordset w/o closing it

Status
Not open for further replies.
Jan 21, 2005
46
US
Hi. I have a working search form and a main form. The search form has a listbox with 9th value as a link criteria(OrderID). When user double clicks a list, the main form opens by an OrderID coming from the search form's recordset. Here's the Form_Load event of the main form.

Dim rs As DAO.Recordset
Set rs = Me.Recordset.Clone
rs.FindFirst "[OrderID] = " & Forms!frmSearchForm!SearchList.Column(8)
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Set rs = Nothing

Right now I have to close the main from and doubleclick a list on the search form again to see a different record on the main form. I want to refresh main from data when I select(doubleclick) another list in search form without closing the main form. I tried something like OrdreID.requery or Form!OrderID.requery in FormLoad or FormCurrent events, but no luck. How could I achieve this? Thanks in advance.
 
Have you tried to put your code in the Form_Activate event instead of the Form_Load ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I tried OrderID.Requery and Me!OrderID.Requery in the Form_Activate event, but it didn't work.
 
I talked about your code setting the Bookmark

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV, thanks for your comment, but I don't understand your last comment. What do you mean?
 
I suggested you to move the code in your 1st post from the From_Load event procedure to the Form_Activate procedure.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV, I tried the code in the Form_Activate event, but it didn't work. What could be wrong?
 
PHV, I hadn't understood correctly what you meant until I suddenly realized it this morning. I put the ENTIRE code section in Form_Activate, and it worked beautifully! Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top