Get parameters for append query

Jan van Bekkum

Registered User.
Local time
Tomorrow, 00:39
Joined
Feb 25, 2010
Messages
23
I have a table named "Proposals" with records with a field ProposalNumber. I have a second table named "LineItems" with a one to many relation through this field ProposalNumber.

In a form in which I can update fields in "Proposals" I want to run a query that appends records to "LineItems". The query has to take field ProposalNumber from the active record of Proposals. How can I get ProposalNumber to be used in the query?
 
Numerous ways. If you're using a saved query:

INSERT INTO ...
VALUES(Forms!FormName!ControlName, ...)
 
Also most forms (if they have a datasource) have an underlying recordset. You can access fields of the recordset by simply me!FieldName provided the field is in use in a control on the form.
 
...provided the field is in use in a control on the form.

Actually it doesn't even need to be in a control on the form. Using the BANG (!) you can set a value of a field that is NOT on the form, as long as it is in the form's recordset and the recordset is updateable.
 

Users who are viewing this thread

Back
Top Bottom