Saving fields from a form to a table

J

Joanne

Hello,
I have a form (frmComputers) and two fields within the form are populated by
a table called tblUsers if and only if the "login" field (.e.g. JSmith), from
tblUsers matches the "computer name" field on frmComputers. The form
frmComputers is actually based on a table called tblComputers. What I'd like
to do is save the value from these fields that are coming in from tblUsers
back to tblComputers. Everything is working fine except the "save" part. I
don't know how to save a field that is coming from one table, back to the
correct value in another table.
 
R

Rob Parker

Use the BeforeUpdate event of the form itself. If the fields in
tblComputers that the data is to be saved to are Field1 and Field2, and the
textbox controls holding the values you want are txtUser1 and txtUser2, all
you need is:

Me.Field1 = txtUser1
Me.Field2 = txtUser2

HTH,

Rob
 
J

Joanne

Thank you very much!

Rob Parker said:
Use the BeforeUpdate event of the form itself. If the fields in
tblComputers that the data is to be saved to are Field1 and Field2, and the
textbox controls holding the values you want are txtUser1 and txtUser2, all
you need is:

Me.Field1 = txtUser1
Me.Field2 = txtUser2

HTH,

Rob
 

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