By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

Overflow Error message

P: n/a
Hi All,
I get the overflow error message when I clicked in a button, but so
far I can't see anything wrong with the code below. Can anybody help?
I'm still a newbie with Access. Any help will be appreciated.

Private Sub Command63_Click()
On Error GoTo Err_Command80_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim Invoice As Integer

Invoice = Me![InvoiceID]
If IsNull(DLookup("[invoiceid]", "[Product]", "[invoiceid]=" &
Invoice)) Then
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
Forms![Product]![InvoiceID] = Invoice
Else
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
End If
Exit_Command80_Click:
Exit Sub
Err_Command80_Click:
MsgBox Err.Description
Resume Exit_Command80_Click

End Sub

Thanks
John
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 11 May 2004 04:09:54 -0700, jn**********@yahoo.com (John) wrote:

On what line are you getting that error? Perhaps InvoiceID can be >
32767, in which case an Integer is not good enough. Change to:
Dim Invoice as Long

-Tom.

Hi All,
I get the overflow error message when I clicked in a button, but so
far I can't see anything wrong with the code below. Can anybody help?
I'm still a newbie with Access. Any help will be appreciated.

Private Sub Command63_Click()
On Error GoTo Err_Command80_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim Invoice As Integer

Invoice = Me![InvoiceID]
If IsNull(DLookup("[invoiceid]", "[Product]", "[invoiceid]=" &
Invoice)) Then
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
Forms![Product]![InvoiceID] = Invoice
Else
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
End If
Exit_Command80_Click:
Exit Sub
Err_Command80_Click:
MsgBox Err.Description
Resume Exit_Command80_Click

End Sub

Thanks
John


Nov 12 '05 #2

P: n/a
Hi Tom,
Thanks for your help, I really appreciated. I changed the Invoice to
Long and it worked fine.
Thank You
John Smith
Tom van Stiphout <to*****@no.spam.cox.net> wrote in message news:<kh********************************@4ax.com>. ..
On 11 May 2004 04:09:54 -0700, jn**********@yahoo.com (John) wrote:

On what line are you getting that error? Perhaps InvoiceID can be >
32767, in which case an Integer is not good enough. Change to:
Dim Invoice as Long

-Tom.

Hi All,
I get the overflow error message when I clicked in a button, but so
far I can't see anything wrong with the code below. Can anybody help?
I'm still a newbie with Access. Any help will be appreciated.

Private Sub Command63_Click()
On Error GoTo Err_Command80_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim Invoice As Integer

Invoice = Me![InvoiceID]
If IsNull(DLookup("[invoiceid]", "[Product]", "[invoiceid]=" &
Invoice)) Then
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
Forms![Product]![InvoiceID] = Invoice
Else
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
End If
Exit_Command80_Click:
Exit Sub
Err_Command80_Click:
MsgBox Err.Description
Resume Exit_Command80_Click

End Sub

Thanks
John

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.