A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Overflow



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2010, 05:43 PM posted to microsoft.public.access.forms
anthony
external usenet poster
 
Posts: 59
Default Overflow

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
  #2  
Old May 25th, 2010, 08:55 PM posted to microsoft.public.access.forms
xps35
external usenet poster
 
Posts: 22
Default Overflow

anthony wrote:


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.

--
Groeten,

Peter
http://access.xps350.com

  #3  
Old May 26th, 2010, 03:10 AM posted to microsoft.public.access.forms
mie via AccessMonster.com
external usenet poster
 
Posts: 9
Default Overflow

Use 'Long' not integer,

Dim intPhotoID As Long

anthony wrote:
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


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1

  #4  
Old May 26th, 2010, 09:12 AM posted to microsoft.public.access.forms
anthony
external usenet poster
 
Posts: 59
Default Overflow

On May 25, 8:55*pm, XPS35 wrote:
anthony wrote:

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.

--
Groeten,

Peterhttp://access.xps350.com


Ah, silly me. Many thanks
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.