I have a combo box on a form(Form1). The drop down contains company names. When a company name is selected their information is filled in on Form1.This works great as long as I stay in this form. I also have a button on the Form1 that opens up Form2. On Form2 I have a button that goes back to Form1. When I go back to Form1 I can use the drop down combo box but it fill in the companies information.
Private Sub Command37_Click()
On Error GoTo Err_Command37_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "F001_Company"
stLinkCriteria = "[T01_01_CompanyName]=" & "'" & Me![T01_01_CompanyName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me.Refresh
Exit_Command37_Click:
Exit Sub
Err_Command37_Click:
MsgBox Err.Description
Resume Exit_Command37_Click
End Sub
Private Sub Command37_Click()
On Error GoTo Err_Command37_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "F001_Company"
stLinkCriteria = "[T01_01_CompanyName]=" & "'" & Me![T01_01_CompanyName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me.Refresh
Exit_Command37_Click:
Exit Sub
Err_Command37_Click:
MsgBox Err.Description
Resume Exit_Command37_Click
End Sub