-
Vba on form
Form f02InvPurchase. The following code is on the VBA page. The first part is working fine. When I click on control T003 it also put whatever is in *ID03 in *ID05 since it is all in the source query. I want to know if it is possible to write to an external table or query. The next line q01InventoryItem!LtstPrce = UnitPrice05 is not doing the job. As said the local form and query is f02InvPurchase and q02InvPurchase. It is field UnitPrice05 in q02InvPurchase that I want to be written to the external query.
Private Sub T003_Click()
If (Me.T001) = 2 Then
Me!CmbEnt_ID15 = Me!CmbEnt_ID03
q01InventoryItem!LtstPrce = UnitPrice05
End If
End Sub
-
you cant write directly to a query, but,
you can put in a subform connected to the query, then write to the subform
me.subform.form.LtstPrce = me.UnitPrice05
-
To write to a query, the query MUST be open - stand alone or as a record source to a form.
You could open the query in code (in a recordset), update the field, then save and close the recordset.
BUT.... how many records will be returned in the query "q01InventoryItem"? Be careful you don't update EVERY record in the query (unless you want every record updated).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules