Assign value to control field using dlookup

tomj

Registered User.
Local time
Today, 13:25
Joined
May 22, 2002
Messages
15
I want to be able to assign a value to a field on a form based on a value from another field plus a counter number and need help!

I have a pulldown field (named "COMPANY") for the user to select a company name. When selected, I run a make-table query (named "COUNT") that gives me a count of all records for that company with the following result in the table:

Company CountofCompany
ACME (text) 4 (number)

I want to join these two values plus add '1' to the count to another field (named "PROJECTID") on the form so in the example, the end result would be PROJECTID = ACME5.

I figure some event procedure would be appropriate in the COMPANY field using the DLOOKUP function - any thoughts? THANK YOU!
 
Tom,

Cancel the MakeTable query. You are obviously trying to assign a
unique number to a new record.

What you really want to do is use the BeforeInsert event of your
form, do a "DMax+1" function call and assign your new number.

Use the Search Facility here and look for "DMax". There are a
lot of examples out there.

Wayne
 

Users who are viewing this thread

Back
Top Bottom