Search Issue/Problem in Access

daft

New member
Local time
Today, 08:44
Joined
Aug 21, 2003
Messages
7
hi guys

Have an issue with opening/searching forms etc in Access...

Usually I'd use the code below to open a form at a particular record, but what I'd like to be able to do is open the form at that particular record, but still be able to scroll up or down through adjacent records.

Does anyone know how to do this?

here's the code I currently use:

stDocName = "frmDetails"

stLinkCriteria = "[txtThingID]=" & "'" & Me![Combo1] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

TIA!

Dave
 
You'll have to take the criteria statement out of the openform command. You could try something like the following in the on_open event of frmDetails:

DoCmd.GoToRecord ,, acFirst
Do Until txtThingID = forms!YourForm!Combo1
DoCmd.GoToRecord ,, acNext
Loop
 
thanks Matt

Maybe I'm being stupid, but that doesn't seem to work for me - are you using A97?

I see what you're saying about dropping the link criteria though
 

Users who are viewing this thread

Back
Top Bottom