Reserved error (-3025); there is no message for this error. (1 Viewer)

snipered

Registered User.
Local time
Today, 05:58
Joined
Jan 19, 2005
Messages
15
Hi, i keep getting the error displayed in the title.

I ma doing a pretty simple query. Just finding a value in one table and inserting it into another.

Does someone know why access does not like it please?

INSERT INTO tblExtend (extendContractID, extendMonths ) VALUES ( (SELECT conID FROM tblContract WHERE conMobileNumber = '5454545'), 12 )
 

namliam

The Mailman - AWF VIP
Local time
Today, 13:58
Joined
Aug 11, 2003
Messages
11,696
Dont think you can do this this way in Access... Try...

INSERT INTO tblExtend (extendContractID, extendMonths )
SELECT conID, 12 FROM tblContract WHERE conMobileNumber = '5454545'

Also a number = '' ??? or is your number field actually a text??
If its a number field you need to lose the '' as well.
 

snipered

Registered User.
Local time
Today, 05:58
Joined
Jan 19, 2005
Messages
15
Hi,

Thanks for the reply. That worked nicely.

Just for the info:
It is a textfield. the reason being a number field for mobile number is too large for the field in access.
 

namliam

The Mailman - AWF VIP
Local time
Today, 13:58
Joined
Aug 11, 2003
Messages
11,696
Not true... a double can contain just about any number...
 

DCrake

Remembered
Local time
Today, 12:58
Joined
Jun 8, 2005
Messages
8,632
Also you may need to trap Null values in your select section. I would wrap this with the Nz() function just in case. Forever pessamistic.

David
 

snipered

Registered User.
Local time
Today, 05:58
Joined
Jan 19, 2005
Messages
15
I'm going to be honest...it didn't cross my mind to use double.

However, it does miss out the 0 at the start.

DCrake, i wasn't aware of the access formula Nz().
Thanks for that.
 

namliam

The Mailman - AWF VIP
Local time
Today, 13:58
Joined
Aug 11, 2003
Messages
11,696
Yes leading zero's are lost... Phone numbers generaly are text because of that very reason...
 

Users who are viewing this thread

Top Bottom