Re: Macro to open a specific record

From: Rick B (anonymous_at_discussions.microsoft.com)
Date: 05/07/04


Date: Fri, 7 May 2004 14:47:24 -0500

You probably won't find much help on here with macros. Seems kinda silly to
create a macro and then tie it to a button on a form. You would end up with
tons of macros.

You should place code behind your button. Assuming there is a field on the
form which contains the primary key, you could do the following...

In the OnClick event, simply enter code similar to...

    DoCmd.OpenForm "SomeFormName", , , "[PrimaryKey]=" & Me![PrimaryKey]

"Lloyd" <anonymous@discussions.microsoft.com> wrote in message
news:a00d01c4346b$3cb0eef0$a001280a@phx.gbl...
I am an Access novice and am trying to design an
application using primarily macros. I am able to use
forms and buttons to create a decent navigation system.

I would also like to associate a macro with a command
button to prompt the user for a primary key value and then
open a form with that record. I know I can do that with a
query, but would prefer to use a macro function directly
if that is possible.

Any help appreciated, Lloyd