Runtime Error 6 Overflow

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
 
B

Bob T

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

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

Grant

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


.
 
C

Chris Nebinger

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


.
.
 
G

Grant

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


.
.
.
 
C

Chris Nebinger

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


.

.
.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top