I am confused.
I want to use Dlookup fill the "STCity" and "STState" fields on my "Quotes" form with the appropriate data from a query "ShipToName" based on the selection in a combo box named "cboCustomer". Here are the functions.
<code>=DLookUp("STCity","ShipToName","STName=cboCustomer")
=DLookUp("STState","ShipToName","STName=cboCustomer")</code>
These functions work perfectly when I open the form object directly.
However in actual use the "Quotes" form is opened via a macro "Prep" behind a button on another form called "Equipment". This macro Opens the "Quotes" form and sets the values of several fields on that form based on the entries previously made on the "Equipment" form. The macro does not reference the "STCity" or "STState" fields. When "Quotes" is opened via the macro the Dlookup functions simply do not run.
What am I missing?
I want to use Dlookup fill the "STCity" and "STState" fields on my "Quotes" form with the appropriate data from a query "ShipToName" based on the selection in a combo box named "cboCustomer". Here are the functions.
<code>=DLookUp("STCity","ShipToName","STName=cboCustomer")
=DLookUp("STState","ShipToName","STName=cboCustomer")</code>
These functions work perfectly when I open the form object directly.
However in actual use the "Quotes" form is opened via a macro "Prep" behind a button on another form called "Equipment". This macro Opens the "Quotes" form and sets the values of several fields on that form based on the entries previously made on the "Equipment" form. The macro does not reference the "STCity" or "STState" fields. When "Quotes" is opened via the macro the Dlookup functions simply do not run.
What am I missing?