Overflow

A

anthony

Why does the last line in this code lead to the error message
"Overflow"? The figure in question is 33764 which is the value of
txtPhotoID before trying to assign it to intPhotoID. If I declare
intPhotoID as String, then all is well

Dim intPhotoID As String
Dim intProjectTeacherID As Integer
Dim strActivity As String
Dim strSequence As String
Dim strProfile As String
Dim DB As Database
Dim RST As Recordset
Set DB = CurrentDb

Set RST = DB.OpenRecordset("tblProjectTeacherPhotoLNK")
intPhotoID = Me.txtPhotoID
 
X

XPS35

anthony said:
Why does the last line in this code lead to the error message
"Overflow"? The figure in question is 33764 which is the value of
txtPhotoID before trying to assign it to intPhotoID. If I declare
intPhotoID as String, then all is well

Dim intPhotoID As String
Dim intProjectTeacherID As Integer
Dim strActivity As String
Dim strSequence As String
Dim strProfile As String
Dim DB As Database
Dim RST As Recordset
Set DB = CurrentDb

Set RST = DB.OpenRecordset("tblProjectTeacherPhotoLNK")
intPhotoID = Me.txtPhotoID

The range for integers is -32.768 tot 32.767.
 

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