I will elaborate. From the main form I have a button that opens the second form (not a subform) and displays records that match the part # from the main form. The second form displays multiple detail recordss for that part # and I have a button to select a different record or return to the form.
This is the code to go from the main form to the second form, created by the Wizard.
Private Sub cmdNCRHistory_Click()
On Error GoTo Err_cmdNCRHistory_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = %22frmNCRDetails%22
stLinkCriteria = %22[P/N]=%22 & %22'%22 & Me![txtMaterialNumber] & %22'%22
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdNCRHistory_Click:
Exit Sub
Err_cmdNCRHistory_Click:
MsgBox Err.Description
Resume Exit_cmdNCRHistory_Click
End Sub
to return to the main form, I have, (again created by the Wizard). When I use this option my combo box is still functional.
Private Sub cmdReturn_Click()
On Error GoTo Err_cmdReturn_Click
DoCmd.Close
Exit_cmdReturn_Click:
Exit Sub
Err_cmdReturn_Click:
MsgBox Err.Description
Resume Exit_cmdReturn_Click
End Sub
To select a different record and return to the main screen with this record displayed I have: (Wizard again)
Private Sub cmdReturnToNCR_Click()
On Error GoTo Err_cmdReturnToNCR_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = %22frmNCR%22
stLinkCriteria = %22[NCRNumber]=%22 & Me![txtNCRNumber]
DoCmd.Close
DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria
Exit_cmdReturnToNCR_Click:
Exit Sub
Err_cmdReturnToNCR_Click:
MsgBox Err.Description
Resume Exit_cmdReturnToNCR_Click
End Sub
After this the combo box can no longer find any records, although the drop down list shows them. I suspect it has something to do with how I returned to the main form by selecting a specific record, highlighted in bold above.
Any help will be appreciated.
Thanks,
Pat