Opening a form to a specific record

BroncoMarc

Registered User.
Local time
Today, 23:53
Joined
Apr 4, 2002
Messages
43
I am making a database of all the computers at my company. It's based on the Dell service tag and includes everything about the computer, cpu, ram , hd, repair history, assigned user, etc.

I want to be able to switch back and forth between 2 forms. One form (frmAssetViewer) is a detailed view which has 1 record per page and has a button to switch to the other view. The other form (frmAssetList) is in datasheet mode and is a table of all the computers. Double clicking on the service tag field will launch the other form.

I have the links working that open the other form, but how do I get them to jump to a specific record?

- Marc
 
You've probably already figured out that you need some code in the double-click event of the service tag field on the frmAssetList form.

As you may have also discovered, you cannot just use an OpenForm command to move an open form to a specified record. You can, however, bring the frmAssetViewer form into focus and then use something like the FindFirst command, a form filter, or use bookmarks to move the form to a specified record.
 
I've got a few things in here I can't figure out. Attached is what I have so far.

I'm still lost on how to jump directly to the record in the new form that I'm in on the current form. Maybe looking at my database will show you where I am.


Also, I have table called history for repair history of computers. It's linked to the main table thru the service tag. I display the history in a list box on the main form, but I'm limiting it to the history current record thru a select statement.

It works, but it doesn't update as I scroll thru the records. I figured out that a requery statement will make it update, but I don't know where to put it. I put it in the got focus event of the list box for now, but I have to click there to get it to work. Where can I put it so it requerys every time the record changes?


1 more minor glitch. Clicking the button to go to the AssetList form opens it in form view instead of datasheet view. If I open the form directly from the database window it opens in datasheet view. How do I get the form button to do the same thing?

Thanks,
- Marc
 

Attachments

Attached is your database with some changes made to it. Take a look and let me know if you have any questions. Basically the form frmAssetList has an unbound control on it which is a listbox. The listbox runs off a query of tblAssets. There is an "on Dbl Click" event which opens your main form frmAssetViewer to the record that was double clicked. I also added an event to the frmAssetList "On Load" which will refresh the data in the listbox.

Hope this helps.

Roelandkim
 

Attachments

Users who are viewing this thread

Back
Top Bottom