Going to Specific Record (1 Viewer)

Wicklund

Registered User.
Local time
Today, 03:24
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????
 

llkhoutx

Registered User.
Local time
Yesterday, 21:24
Joined
Feb 26, 2001
Messages
4,018
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.
 

Wicklund

Registered User.
Local time
Today, 03:24
Joined
Jun 7, 2002
Messages
56
Thank you.

When I use this however, I get a message box that is prompting me to 'Enter Parameter Value' for 'Filter'.
 

Wicklund

Registered User.
Local time
Today, 03:24
Joined
Jun 7, 2002
Messages
56
Here is how I entered the code:

Me.Filter = "[Filter]='" & Me![IG Num] & "'"
Me.FilterOn = True
Me.Requery
 

llkhoutx

Registered User.
Local time
Yesterday, 21:24
Joined
Feb 26, 2001
Messages
4,018
If IG Num is numeric, you don't need the single quotes.

Me.Filter = "[Filter]=" & Me![IG Num]
 

Wicklund

Registered User.
Local time
Today, 03:24
Joined
Jun 7, 2002
Messages
56
I tried it with, and without, the single quotes, got a different error without (The [IG Num] is not numeric).
 

Mile-O

Back once again...
Local time
Today, 03:24
Joined
Dec 10, 2002
Messages
11,316
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...
 

Wicklund

Registered User.
Local time
Today, 03:24
Joined
Jun 7, 2002
Messages
56
That worked! I didn't have the Field Name in there correctly.

Thank you,
 

Users who are viewing this thread

Top Bottom