Update Table from an unbound form

G

Guest

Is it possible to update a table from an unbound form? I can do this and
append data to a table but in this case, I already have data in the table and
want to update 2 or 3 fields in a specific record in a specific table.
Thanks for the help....
 
G

Guest

Sure, it is exactly the same, except you don't use the .AddNew. You just
have to position your table so the record you want to update is the current
record.
rstMyRecSet![SOME_STUFF] = Me.txtSomeStuff
rstMyRecSet![OTHER_STUFF] = Me.txtOtherStuff
rstMyRecSet.Update
 
M

Margaret Bartley

Another way is to use RunSQL:

strFormFieldName=Me.FormFieldName
DoCmd.RunSQL "UPDATE [MyTable] SET [FieldName] = '" & strFormFieldName &
"'"

or
iFormFieldName=Me.FormFieldName
DoCmd.RunSQL "UPDATE [MyTable] SET [FieldName] = " & iFormFieldName & "
 

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