Help please! Update issue with sql statement

Bigmo2u

Registered User.
Local time
Today, 12:54
Joined
Nov 29, 2005
Messages
200
I have a table that needs to be updated after it is imported. It keeps asking me for a perameter. Here is what I have.

Code:
Dim uSDN As String
Dim aStatus As String

aStatus = "A"

uSDN = "UPDATE tblSDN Set tblSDN.Status = aStatus WHERE tblSDN.Status Is Null"

DoCmd.RunSQL uSDN

I went as far as assigning the variable because it keeps asking for a perameter.

I know it is something simple and I am just missing it. End of the day and I am losing my mind.

I messed around with the Null issue, but that is not throughing me any errors right now.

Thanks for you help in advance.
 
I have a table that needs to be updated after it is imported. It keeps asking me for a perameter. Here is what I have.

Code:
Dim uSDN As String
Dim aStatus As String
 
aStatus = "A"
 
uSDN = "UPDATE tblSDN Set tblSDN.Status = aStatus WHERE tblSDN.Status Is Null"
 
DoCmd.RunSQL uSDN

Try this:
Code:
Dim uSDN As String
Dim aStatus As String
 
aStatus = "A"
 
uSDN = "UPDATE tblSDN Set tblSDN.Status = '" & aStatus & "' WHERE tblSDN.Status Is Null"
 
DoCmd.RunSQL uSDN
 
georgedwilkinson - Thank you so much. '" & aStatus & "' setup gets me everytime, just don't understand how that works or why it has to be there. other times it is " & aStatus. just confusing to me.
 
'" & aStatus & "' is for text fields
" & aStatus is for number fields
#" & aStatus & "# is for date fields.
 
namliam - Thank you so much for clearing that up for me. I will put that in my notes.
 

Users who are viewing this thread

Back
Top Bottom