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

Form - go to specific record

Status
Not open for further replies.

rjoubert

Programmer
Oct 2, 2003
1,843
US
I have an Access 2003 application with a main data form, and a search form. A user would open the search form with a button on the main data form, leaving the main data form open. When a search is executed, I want to allow the user to either double-click on a search result (in a list box), or highlight the result and click on a View button.

I had this working at one point by using the DoCmd.GoToRecord method...the reason this worked was because I had an autonumber field that corresponded to the record number, and I passed that in as the offset parameter. Now that autonumber field is gone, so I have to find another way to navigate the main form to the desired record. The key for the data is now composed of two fields.

I can't use the DoCmd.OpenForm method, passing in a Where parameter, as the main data form is already open. And I can't use the DoCmd.FindRecord because the code is on the Search form, and I need to find a record on the main data form.

Now, if I haven't totally confused you with this long-winded explanation, feel free to post a suggestion or two.
 
Nevermind, I figured it out. I was able to set the main data form's bookmark to the record I wanted to see.
 
Can the search form be used to collect search value only - perhaps assigning it to a global variable in std module? When return to Main, could you click a search button that executes code to retrieve global value? "Just a thought."
Jeff
 
Why is the autonumber or "key" gone?

If it's a relational database then their should be a unique key of some sort (provided it is set up correctly)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top