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

Open a form to edit to a specific text box

P: 3
I am using access 2003 with windows xp. I have created a data base for to keep track of my 180 employees. I have created a table with 21 records. Then I created a form to input employee data. I then created a switchboard to open a blank form. Now I want to use the swithchboard to open the form to a specific text box. ie, Edit Active Employees. I would like to do this by last name or SSN, two of the fields in the table. I can get it to open the table to the specific employee but not open the form to that employee. It always defaults to the first record. Thanks in advance for any and all help.

Don Croner
Dec 15 '06 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
I am using access 2003 with windows xp. I have created a data base for to keep track of my 180 employees. I have created a table with 21 records. Then I created a form to input employee data. I then created a switchboard to open a blank form. Now I want to use the swithchboard to open the form to a specific text box. ie, Edit Active Employees. I would like to do this by last name or SSN, two of the fields in the table. I can get it to open the table to the specific employee but not open the form to that employee. It always defaults to the first record. Thanks in advance for any and all help.

Don Croner
You need a form with for instance a drop down list of employees and their SSN no. The row source for the combo box would be

Expand|Select|Wrap|Line Numbers
  1. SELECT SSN, EmpName FROM TableName ORDER BY EmpName;
or something like that the SSN No would be the bound column and could be set to invisible so it doesn't appear to the users.

Choose a user from the list and set a command button on the form e.g. cmdFindEmp and put the following code behind the button.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdFindEmp_Click()
  2.  
  3.    DoCmd.OpenForm "FormName", , , "[SSN]=" & Me.ComboboxName
  4.  
  5. End Sub
  6.  
Mary
Dec 15 '06 #2

Post your reply

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