AUTO FILL FIELD

stm8ter

Registered User.
Local time
Today, 22:47
Joined
Jan 26, 2002
Messages
21
I have a table that contains project information
ProjectName
ProjectAddress
ProjectNumber
etc.

I would like to have the PurchaseOrder form automaticaly enter the ProjectNumber on the form when the ProjectName is entered. I have been able to acomplish this in PurchaseOrder report, however I am not getting it to appear on the form screen. The form screen is used most of the time when orders are being written over the telephone. Entry person does not know all ProjectNumbers and would otherwise have to look it up on the projectscreen.

Thank You for your help.
 
Me![ProjectNumber] = DLookup("[ProjectNumber]","TableName","[ProjectName] = '" & Me![ProjectName] & "'")
 
Thanks for your help Jack. I am sorry but you are a little over my head. I am not exactly sure what you are telling me to do.
I may need it a little more basic. I am relativly new to access. Have kind of forced my way through most of the stuff. Have a DB that is working (Kind of) although I need to make some changes.

If I understand you responce
I entered the field properties control source and entered the folloing.
=[Me]![ProjectNumber]=DLookUp("JobNumber]","Projects","[ProjectName]='" & [Me]![ProjectName] & "'")


When my info is
Table is named Projects
Field is named ProjectName
ProjectNumber is named JobNumber

I keep getting a #Name?
I did not enter the [] around the Me control source keeps doing this and I can not get it to enter without it.

Am I missing what your are telling me or am I in the wrong area.
 
I am sorry for the lack of information in my reply. Sometimes I assume too much...

If the field on your form that is to get the JobNumber is called "JobNumber" then in the After Update event of the Project Name field (where the user selects the project name) us code like the code I suggested.

Me![JobNumber]=DLookUp("[JobNumber]","Projects","[ProjectName]='" & Me![ProjectName] & "'")

The second [ProjectName] is the name of the field on your form that has the Project Name selected by the user.

I hope this clears it up for you...
 
In case it matters I am using Access 2000

On the Purchase Order Form
In the Project Name field
the entry person picks the project from a

combo box named ProjectName
control cource is =[PoProjectName]
row source is SELECT [Projects].[ProjectsID], [Projects].[ProjectName] FROM [Projects]

Now I want the ProjectNumber automaticaly appear in a field (Text Box)

Text Box Named JobNumber
Event Tab
After Update
Me![JobNumber]=DLookUp("[JobNumber]","Projects","[ProjectName]='" & Me![ProjectName] & "'")
This gives me an error message “The Value you entered isn’t valid for this field.”
So I check the
Table named Projects
Field named JobNumber Text
Sorry, I am sure this is a simple thing but I am just not getting it.
 

Users who are viewing this thread

Back
Top Bottom