goto specific record

G

Guest

Hi,
I would like to use the "goto" macro to direct opening of a form at a
specific record which is entered into a message box. I want the user to enter
the primary key [ID]number of the record (which is not the the same number as
the record number).

Any suggestions gratefully accepted.

Michael D
 
S

Steve Schapel

Michael,

It is not possible to use a GoToRecord action in a macro in the way you
are suggesting.

Try it like this... Put an unbound textbox on the form that you are
calling the macro from. The user can enter the ID required into this
textbox. Then, in the macro, use the OpenForm action, and in the Where
Condition argument, put the equivalent of this...
[ID]=[Forms]![NameOfForm]![NameOfTextbox]

An equivalent approach is to use a Query as the Record Source of the
Form, and then enter the equivalent of...
[Forms]![NameOfForm]![NameOfTextbox]
.... into the Criteria of the ID field in the query. Then just use the
OpenForm action in the macro, with no need for a Where Condition.
 

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

Top