Sequential Number Dlookup

connerlowen

Registered User.
Local time
Today, 16:12
Joined
May 18, 2015
Messages
204
Hi,

I have a form that generates a sequential number called the "QuoatationNumber". I would like this QuotationNumber to appear in a text box at the top of all of the following forms until the quotation is finished. I have tried DLookUp, but it only gets the first quotationnumber and does not get the next number when a new quotation is started.

Thanks,

Conner Owen
 
build a query that pulls the Q#....This query is the recordsource of your combo.
when a new record is created , via save button, also include a: cboQ.requery
to update the list.
 
I have a Query. That is where the DLookUp function is looking. It is now saying that the database cannot find the "QuotationNumber" field in the expression.
 
Discussion continued here; please don't post the same question twice.
 
This is a different question. The other thread deals with the error message. This thread deals with text boxes within other forms.
 
How do I use the DMax function within the DLookUp function? my function as of right now says =DLookUp("QuotationNumber","NewQuotationQ") that is the field within the query I created.
 
How about simply passing the Number along the forms using the open args of DoCmd.openform and/or using the "On Open" of the form to pick it from the previous form?
 
Control Source
=DLookUp("QuotationNumber","NewQuotationQ","[QuotationID]=" & DMax("[QuotationID]","[NewQuotationQ]"))
 
Fyi, you could also achieve the same thing by:
* creating a query based on NewQuotationQ
* include only the QuotationID and QuotationNumber fields
* sort QuotationID in Descending order - crucial part of this process
* save the query and...
* use only the DLookup() to grab the QuotationNumber
Code:
=DLookup("QuotationNumber", "[COLOR="Blue"]NewQueryHere[/COLOR]")
 
Ugh, each form doing a dlookup :(

Instead just pass it along using the openargs, saves a lot of I/O and thus a lot of time...
 

Users who are viewing this thread

Back
Top Bottom