B
BlueWolverine
Hello,
MS Access 2003 on XP Pro.
So I have a little code snippet. I know there is a more direct way to do
what I am doing but I tried it and I don't like it. (Link the form to the
table so that changes to field link back to the table directly.)
What I really want is the following code to work.
Dim v_Color As String, v_VIN As String, strSQL As String
If IsNull(Me.ExtColor.Value) Or Me.ExtColor.Value = "" Then
v_Color = "Not Specified"
Else
v_Color = Me.ExtColor.Value
End If
v_VIN = Me.VIN.Value
strSQL = "UPDATE t_VehicleInventory SET t_VehicleInventory.Color = '" &
v_Color & "' " & _
"WHERE (((t_VehicleInventory.VIN)='" & v_VIN & "'));"
DoCmd.SetWarnings False
MsgBox strSQL
DoCmd.OpenQuery strSQL
This on exit the field whose value I want to force back into the table.
Here's the error I get.
<><><>
Run-time error '7874':
Microsoft Office Access can't find the object 'UPDATE
t_VehicleInventory SET t_VehicleInventory.Color = 'Not Specified'
Where (((t_VehicleInventory.VIN)='ABCDEFGHIJKLMNOPQ'));.'
<><><>
Thank you in advance for your help.
MS Access 2003 on XP Pro.
So I have a little code snippet. I know there is a more direct way to do
what I am doing but I tried it and I don't like it. (Link the form to the
table so that changes to field link back to the table directly.)
What I really want is the following code to work.
Dim v_Color As String, v_VIN As String, strSQL As String
If IsNull(Me.ExtColor.Value) Or Me.ExtColor.Value = "" Then
v_Color = "Not Specified"
Else
v_Color = Me.ExtColor.Value
End If
v_VIN = Me.VIN.Value
strSQL = "UPDATE t_VehicleInventory SET t_VehicleInventory.Color = '" &
v_Color & "' " & _
"WHERE (((t_VehicleInventory.VIN)='" & v_VIN & "'));"
DoCmd.SetWarnings False
MsgBox strSQL
DoCmd.OpenQuery strSQL
This on exit the field whose value I want to force back into the table.
Here's the error I get.
<><><>
Run-time error '7874':
Microsoft Office Access can't find the object 'UPDATE
t_VehicleInventory SET t_VehicleInventory.Color = 'Not Specified'
Where (((t_VehicleInventory.VIN)='ABCDEFGHIJKLMNOPQ'));.'
<><><>
Thank you in advance for your help.