Runtime Error 6 Overflow

  • Thread starter Thread starter Grant
  • Start date Start date
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
 
Unless there is a typo in your request, the criteria for the DCOUNT has extrac characters

If DCount("*", "NewLeads", "[CustomerID]= " ' " & Me!CustomerID & " ' ") > 0 The
 
What do you mean "extrac characters"? How should it be
written?

Thanks

-----Original Message-----
Unless there is a typo in your request, the criteria for
the DCOUNT has extrac characters.
If DCount("*", "NewLeads", "[CustomerID]= " ' " & Me! CustomerID & " ' ") > 0 Then


.
 
Looks good to me. Where does the overflow error occur?

Chris Nebinger
-----Original Message-----

What do you mean "extrac characters"? How should it be
written?

Thanks

-----Original Message-----
Unless there is a typo in your request, the criteria for
the DCOUNT has extrac characters.
If DCount("*", "NewLeads", "[CustomerID]= " ' " & Me! CustomerID & " ' ") > 0 Then


.
.
 
I have a button on a form that runs the OnClick event..
Can't figure it out.. Also.. It dosen't happen on every
machine.. only a few.. I don't know what to look for...

Thanks

-----Original Message-----
Looks good to me. Where does the overflow error occur?

Chris Nebinger
-----Original Message-----

What do you mean "extrac characters"? How should it be
written?

Thanks

-----Original Message-----
Unless there is a typo in your request, the criteria
for
the DCOUNT has extrac characters.
If DCount("*", "NewLeads", "[CustomerID]= " ' " & Me! CustomerID & " ' ") > 0 Then


.
.
.
 
Well, you need to figure out what is causing the error.
What specific line does it occur on? What values are you
looking up?

There has to be a reason.


Chris Nebinger


-----Original Message-----

I have a button on a form that runs the OnClick event..
Can't figure it out.. Also.. It dosen't happen on every
machine.. only a few.. I don't know what to look for...

Thanks

-----Original Message-----
Looks good to me. Where does the overflow error occur?

Chris Nebinger
-----Original Message-----

What do you mean "extrac characters"? How should it be
written?

Thanks


-----Original Message-----
Unless there is a typo in your request, the criteria for
the DCOUNT has extrac characters.

If DCount("*", "NewLeads", "[CustomerID]= " ' " & Me!
CustomerID & " ' ") > 0 Then


.

.
.
.
 
Back
Top