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

List box and command button.

P: 10
I've created a list box with employee names in it. when highlighting and clicking the search command button i've created it does nothing... can someone give me a code to use so when selecting the employee and hitting search it goes to that users information.
Oct 23 '06 #1
Share this Question
Share on Google+
2 Replies


100+
P: 143
What is the code you have so far? Table names, fieldnames and form name would help.
Oct 23 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
In the On Click Event of the button ('cmdSearch' for this example) put the following code.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private cmdSearch_OnClick()
  3. Dim stDocName As String
  4. Dim stLinkCriteria As String
  5.  
  6.    stDocName= "Name of Employee record form"
  7.    stLinkCriteria="EmployeeID=" & Me.ListBoxName
  8.  
  9.    DoCmd.OpenForm stDocName, , , stLinkCriteria
  10.  
  11. End Sub
  12.  
I've created a list box with employee names in it. when highlighting and clicking the search command button i've created it does nothing... can someone give me a code to use so when selecting the employee and hitting search it goes to that users information.
Oct 23 '06 #3

Post your reply

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