Can I do this update query?? (1 Viewer)

Marinus

I'm learning... :)
Local time
Today, 09:58
Joined
Jun 16, 2010
Messages
140
Hi All,
Happy Valentine :)

On my form I have 2 textboxes named as in the code, there is also a query that shows the current order. All is there except for the price, so I thought to input the price ID number in a unbound textbox and run the Update query below.

I was wrong, when I click the mouse on the Unbound txtUpdateID I get a missing operator runtime error 3075, must be to sleepy, as I have this working in other locations..

Code:
CurrentDb.Execute "UPDATE TblDocketBuy SET [B_Price] = " & Me.txtB_Price & " WHERE ID = " & Me.txtUpdateID & ";"

Can anyone see my typo??
 

vbaInet

AWF VIP
Local time
Today, 09:58
Joined
Jan 22, 2010
Messages
26,374
What is the data type of ID?

My suspicion is that you will need to test for Null and zls before executing.
 

Marinus

I'm learning... :)
Local time
Today, 09:58
Joined
Jun 16, 2010
Messages
140
What is the data type of ID?

My suspicion is that you will need to test for Null and zls before executing.

Both are numeral, I checked, from table to fields, ID is AutoNumber as it is an order line and the price is standard number, when debugging and hovering over the txtUpdateID, debugger gives me a value of Null.. But I can't even input a number in the text box.. Strange.. When I don't debug and press End, I can enter a Value and the Update worked..
 
Last edited:

vbaInet

AWF VIP
Local time
Today, 09:58
Joined
Jan 22, 2010
Messages
26,374
... when debugging and hovering over the txtUpdateID, debugger gives me a value of Null..
Is this textbox bound to the Autonumber ID field?

But I can't even input a number in the text box.. Strange.. When I don't debug and press End, I can enter a Value and the Update worked..
If you're still debugging then you won't be able to do anything on the form. Also if the textbox is bound to an AutoNumber field you won't be able to change it.
 

Marinus

I'm learning... :)
Local time
Today, 09:58
Joined
Jun 16, 2010
Messages
140
What is the data type of ID?

My suspicion is that you will need to test for Null and zls before executing.

Thanks for looking, somehow I must have pasted the code on the on click of the text box, removed that and it works.. See what would I do without your inspiration.. :D
 

vbaInet

AWF VIP
Local time
Today, 09:58
Joined
Jan 22, 2010
Messages
26,374
Happy to help!

What are we doing awake at 2.45 a.m. :D
 

Marinus

I'm learning... :)
Local time
Today, 09:58
Joined
Jun 16, 2010
Messages
140
Happy to help!

What are we doing awake at 2.45 a.m. :D

Guess we ran out of reruns of Man United?? :rolleyes: Should go to bed, didn't sleep for three nights.. There is so much to learn, but I seem to be getting there.. Probably not as it should but he..it works..
 

vbaInet

AWF VIP
Local time
Today, 09:58
Joined
Jan 22, 2010
Messages
26,374
I guess you enjoyed your Valentine weekend ;)

Happy coding!
 

Users who are viewing this thread

Top Bottom