A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro to open a specific record



 
 
Thread Tools Display Modes
  #1  
Old May 7th, 2004, 08:41 PM
Lloyd
external usenet poster
 
Posts: n/a
Default Macro to open a specific record

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
  #2  
Old May 7th, 2004, 08:47 PM
Rick B
external usenet poster
 
Posts: n/a
Default Macro to open a specific record

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" wrote in message
...
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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.