By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,709 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,709 IT Pros & Developers. It's quick & easy.

command button

P: 553
I want to create a command button . when pressed, an appropriate form should be opened associated with the Surname value.

There are tables associated to each Surname. On the form, when the command button is pressed, i want to open another form( already created which has detail associated with the surname) to be opened.

Please help. how can i start?

Feb 15 '07 #1
Share this Question
Share on Google+
2 Replies

P: 49
To open a from simply make a command button and in the code put:

Expand|Select|Wrap|Line Numbers
  1. doCmd.openform "FormName"
And if you want to close a form through a button put this in the code:

Expand|Select|Wrap|Line Numbers
  1. doCmd.Close
As far as the Surname value I am not quite sure what you are asking about that, please try explaining it differently. Are you wanting to say have a query in a from and be able to select a record from the query and click the button to open the form and the data of that record appears on the from that opened?
Feb 15 '07 #2

Expert Mod 15k+
P: 31,489
Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.OpenForm("FormName",,,"[Surname]='Bloggs'")
Feb 15 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.