jsmith1611
Registered User.
- Local time
- Today, 11:21
- Joined
- Jan 7, 2009
- Messages
- 23
Hello, I am trying to update a table using a sql statement in vba. I am getting a data type mismatch error and I think it is in my "where" clause. The wire_id field on the incoming_wires table is an autoNumber field and the primary key of the table. The wireid field on the form is a text field. Here is my code:
'update incoming_wires table
Dim strsql_2a As String
strsql_2a = "update incoming_wires " & _
"set incoming_wires.first = '" & Me.newFirst & "' where incoming_wires.wire_id = " & cast(wireid as integer)
DoCmd.RunSQL strsql_2a
I have tried many methods to convert the wireid to a number for a proper comparison with no luck. Can someone please help?
Thanks,
Joshua Smith
'update incoming_wires table
Dim strsql_2a As String
strsql_2a = "update incoming_wires " & _
"set incoming_wires.first = '" & Me.newFirst & "' where incoming_wires.wire_id = " & cast(wireid as integer)
DoCmd.RunSQL strsql_2a
I have tried many methods to convert the wireid to a number for a proper comparison with no luck. Can someone please help?
Thanks,
Joshua Smith