G
Grant
Can someone take a look at this code? It produces a
Runtime error 6 overflow on some computers:
Thank You
Private Sub CustRecBtn_Click()
On Error GoTo Err_CustRecBtn_Click
If DCount("*", "NewLeads", "[CustomerID]=" & "'" & Me!
[CustomerID] & "'") > 0 Then
DoCmd.OpenForm "New Leads Filtered", , , "[CustomerID]
=" & "'" & Me![CustomerID] & "'"
GoTo NL_CustRecBtn_Click
ElseIf DCount("*", "ExistingCustomers", "[CustomerID]="
& "'" & Me![CustomerID] & "'") > 0 Then
DoCmd.OpenForm "ExistingCustomers
Filtered", , , "[CustomerID]=" & "'" & Me![CustomerID]
& "'"
GoTo EC_CustRecBtn_Click
Else: MsgBox "This appointment is not linked to any
customer.", _
vbExclamation + vbOKOnly, _
"Go To Customer Record Button"
GoTo Exit_CustRecBtn_Click
End If
NL_CustRecBtn_Click:
DoCmd.Close acForm, "frmAppointment"
DoCmd.SelectObject acForm, "New Leads Filtered"
Exit Sub
EC_CustRecBtn_Click:
DoCmd.Close acForm, "frmAppointment"
DoCmd.SelectObject acForm, "Existingcustomers Filtered"
Exit Sub
Exit_CustRecBtn_Click:
Exit Sub
Err_CustRecBtn_Click:
MsgBox Err.Description
Resume Exit_CustRecBtn_Click
End Sub
Runtime error 6 overflow on some computers:
Thank You
Private Sub CustRecBtn_Click()
On Error GoTo Err_CustRecBtn_Click
If DCount("*", "NewLeads", "[CustomerID]=" & "'" & Me!
[CustomerID] & "'") > 0 Then
DoCmd.OpenForm "New Leads Filtered", , , "[CustomerID]
=" & "'" & Me![CustomerID] & "'"
GoTo NL_CustRecBtn_Click
ElseIf DCount("*", "ExistingCustomers", "[CustomerID]="
& "'" & Me![CustomerID] & "'") > 0 Then
DoCmd.OpenForm "ExistingCustomers
Filtered", , , "[CustomerID]=" & "'" & Me![CustomerID]
& "'"
GoTo EC_CustRecBtn_Click
Else: MsgBox "This appointment is not linked to any
customer.", _
vbExclamation + vbOKOnly, _
"Go To Customer Record Button"
GoTo Exit_CustRecBtn_Click
End If
NL_CustRecBtn_Click:
DoCmd.Close acForm, "frmAppointment"
DoCmd.SelectObject acForm, "New Leads Filtered"
Exit Sub
EC_CustRecBtn_Click:
DoCmd.Close acForm, "frmAppointment"
DoCmd.SelectObject acForm, "Existingcustomers Filtered"
Exit Sub
Exit_CustRecBtn_Click:
Exit Sub
Err_CustRecBtn_Click:
MsgBox Err.Description
Resume Exit_CustRecBtn_Click
End Sub