How to make update a field of a table

D

David Bowen

I am trying to update the field [dummylink] which is in the table [tblGeneral Contract Information]with strInputtext (this variable is a string)

When it runs it does not seem to do anything at all.


CurrentDb.Execute "UPDATE [tblGeneral Contract Information] SET [dummylink] = '" & strInputtext & "'" & "WHERE [tblGeneral Contract Information]![V File Number] = " & "'Me.[V File Number]'", dbFailOnError


Could you please help.
 
M

Marshall Barton

David said:
I am trying to update the field [dummylink] which is in the table [tblGeneral Contract Information]with strInputtext (this variable is a string)

When it runs it does not seem to do anything at all.


CurrentDb.Execute "UPDATE [tblGeneral Contract Information] SET [dummylink] = '" & strInputtext & "'" & "WHERE [tblGeneral Contract Information]![V File Number] = " & "'Me.[V File Number]'", dbFailOnError


The quotes for the second value are not right:

"UPDATE [tblGeneral Contract Information] SET [dummylink] =
'" & strInputtext & "' WHERE [tblGeneral Contract
Information]![V File Number] = '" & Me.[V File Number] & "'
", dbFailOnError
 
D

David Bowen

If you mean this = '" & Me.[V File Number] & "'

That is good to know. The problem is that if I remove this I get a "data miss match" error.
 
M

Marshall Barton

David said:
If you mean this = '" & Me.[V File Number] & "'

That is good to know. The problem is that if I
remove this I get a "data miss match" error.


Line wrap might have obscured what I said.
Trying again to get it all on one line:
. . . = '" & Me.[V File Number] & "' ", . . .

However, that error implies that [V File Number] is a
numeric type field in its table. If that's the case, then
it should be:
. . . = " & Me.[V File Number], . . .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top