Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query?

Status
Not open for further replies.

Smoores

Programmer
Jun 5, 2002
9
CA
I have two tables that share at least one field (ProductID). When a user changes data on a form, the Product Table gets updated correctly but the OrderItems Table does not. Can anyone tell me the correct SQL statement to update the OrderItems Table from the Product Table?

Cheers
Smoores
 
Here is a way to do it in code:

Dim rst As DAO.Recordset

Set rst = CurrentDb.OpenRecordset("OrderItems", dbOpenDynaset)

rst.FindFirst "[ProductID] =" & Me.ProductID
rst.Edit
rst![Date].Value = Me.Date
rst.Update
rst.Close

You will have to change the names of table and fields but this will work Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
 
Thanks for the heads-up. I developed an update query that does what is needed. I have just the place for that code that you suggested to me, though. Thanks again, Dave!

Smoores
[thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top