Going to Specific Record

Wicklund

Registered User.
Local time
Today, 21:50
Joined
Jun 7, 2002
Messages
56
When I select a choice from a combo box on a form, I would like the form to go to the record specified in the combo box.

I tried to use the: [docmd.GotoRecord,,acGoto] But I don't know how to identify the record of my choosing by its record number.

Any ideas????
 
One simple way to do this is to use the the form filter property.

On yourcombobox AfterUpdate event:

me.filter="[Filter]=" & me!yourcombobox
or
me.filter="[Filter]='" & me!yourcombobox & "''

me.filteron=true
me.requery

You're desired record is displayed.
 
Thank you.

When I use this however, I get a message box that is prompting me to 'Enter Parameter Value' for 'Filter'.
 
Here is how I entered the code:

Me.Filter = "[Filter]='" & Me![IG Num] & "'"
Me.FilterOn = True
Me.Requery
 
If IG Num is numeric, you don't need the single quotes.

Me.Filter = "[Filter]=" & Me![IG Num]
 
I tried it with, and without, the single quotes, got a different error without (The [IG Num] is not numeric).
 
Is the field you are filtering on actually called [Filter] ?

If not, then change it to the name of the field you are filtering on i.e [Name] = , or [Address] = , or [Supplier] = , etc...
 
That worked! I didn't have the Field Name in there correctly.

Thank you,
 

Users who are viewing this thread

Back
Top Bottom