Help with FindRecord

G

Guest

Hello again and thanks in advance..

I've got an orders table with a primary key of OHID (autonum). Ideally the
user could type the order they want to pull up in ctlOHID and have that
record be called up.

Since I'm using an autonumber, I can't have the user enter a value directly
into that field, so I have another unbound text box set up called
ctlOHGoToRec. In the afterupdate section of this I am trying to put this
code:

Dim varOHNewRec as Long
varOHNewRec = Me.ctlOHGoToRec
DoCmd.FindRecord varOHNewRec, , , , , acAll

When this code runs I get the following error:

2162: A macro set to one of the current fields properties failed because of
an error in a FindRecord action argument.

I don't see what it is I'm doing wrong, I thought all of the args would
work, but I've try to lay this out a few different ways (FindRecord
ctlOHGoToRec) but it doesn't take for some reason. Anybody have any ideas?

Thanks,
Jack
 
G

Guest

Try the following in the After Update event of ctlOHGoToRec:

Me.ctlOHID = Me.ctlOHGoToRec

See if that works for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

FindRecord Error 2
FindRecord help 1
FindRecord problem 1
Find record RunSQL in a crosstab query 11
FindRecord Problem 7
Problem with FindRecord in Access 2007 1
DoCmd.FindRecord 5
FindRecord Code problem 1

Top