I have 2 pop up forms which come from a main data entry form. The pop up forms are populated by a list box. When double clicking on the list, that entry is then pulled up on the main form.
My problem: I've gotten both sets of code to work - BUT NOT AT THE SAME TIME. It seams that they are conflicting for some reason - but now sure why. I think it may even be changing the code once I click on the DoCmd.Close. Not sure if I am going crazy!! Thoughts?? Below is the code...
My problem: I've gotten both sets of code to work - BUT NOT AT THE SAME TIME. It seams that they are conflicting for some reason - but now sure why. I think it may even be changing the code once I click on the DoCmd.Close. Not sure if I am going crazy!! Thoughts?? Below is the code...
Code:
Private Sub cmdShowActiveLeads_Click()
Dim rs As DAO.Recordset
Set rs = Forms!frmLeadMain1.RecordsetClone
'Dim stLeadSearch As String
'stLeadSearch = "[Lead#']= "
Call rs.FindFirst("[Lead#] =" & Me.Ctl1stLead.Value)
Forms!frmLeadMain1.Recordset.Bookmark = rs.Bookmark
Call DoCmd.Close(acForm, "frmFindActiveLead")
End Sub
Private Sub List4_AfterUpdate()
Me.cmdShowActiveLeads.Enabled = True
End Sub
Private Sub List4_DblClick(Cancel As Integer)
If Not IsNull(Me.List4.Value) Then
Call cmdShowActiveLeads_Click
End If
End Sub
Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
DoCmd.Close
Exit_Command3_Click:
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command3_Click
End Sub
Code:
Option Compare Database
Private Sub cmdShowCurrentTenant_Click()
Dim rs As DAO.Recordset
Set rs = Forms!frmLeadMain1.RecordsetClone
'Dim stLeadSearch As String
'stLeadSearch = "[Lead#']= "
Call rs.FindFirst("[Lead#] =" & Me.List4.Value)
Forms!frmLeadMain1.Recordset.Bookmark = rs.Bookmark
Call DoCmd.Close(acForm, "frmFindCurrentTenant")
End Sub
Private Sub List4_AfterUpdate()
Me.cmdShowCurrentTenant.Enabled = True
End Sub
Private Sub List4_DblClick(Cancel As Integer)
If Not IsNull(Me.List4.Value) Then
Call cmdShowCurrentTenant_Click
End If
End Sub
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
DoCmd.Close
Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click
End Sub
Comment