Trouble using two forms

  • Thread starter Thread starter wislndixie
  • Start date Start date
W

wislndixie

Guest
I created table 1 and form 1 with employee names, addresses, etc. I created table 2 and form 2 that I track employee contributions to health, dental, etc. On my form 1, I inserted a command button to open form 2 and it works fine. My problem is when I'm on employee number 4 and click the open form 2 button, it always opens to employee # 1. I can't seem to link the employee data in form 1 to the data in form 2 for the same employee.

I linked my tables SS# to SS# and I thought that would do the trick. Can someone help?
Thanks,
Wisln
 
Use the wizard to add an OpenForm button...select the one that says something about opening the form to a specific record.
 
Use Docmd.OpenForm to solve your problems. Add this code to your command button 's Click_Event

For example

Code:
Dim strSQL As String
strSQL = "(table2.EmployeeID=[Forms]![Form1]![Employee_ID])"
DoCmd.OpenForm "Form2", , , strSQL

* Make sure Form2 's Data has been set already! Something like query or SQL or Table!
 

Users who are viewing this thread

Back
Top Bottom