Auto populating fields from a different field

thalam

Registered User.
Local time
Yesterday, 21:19
Joined
Feb 20, 2006
Messages
27
Hi there,

I've been working on this issue for quite sometime. I've tried different methods, such as the DLookup function, but I think I'm doing something wrong. Let me explain what I'm trying to do:

This is a Work Order, the user will Select a Customer (Table Customer: Contains CustomerID and Customer Name, address, etc) from a drop down box. When they do this, I have another textbox which is designated for the Address. I would like the address to automatically populate. but its not quite working. I've tried it with the DLookup function (I entered it into the control source of the textbox). I entered the following syntax:

=DLookup("Address","Customer","CustID=" & cboCustId)

It keeps coming up with an error. I have no idea why.

Now this is just the first half. The second half I have a subform on the same main form, which lists the equipment they have on their site. The database has a number of customers with many equipment for each of them. How do I make sure that the subform only populates equipment associated with the Customer that was selected on the main form?

I hope someone is able to help me.

Thanks a lot!
 
Try:
Use a combobox to select the customer.
Use the wizard to make the combobox and choose "find a record" when asked what it is you want to do with the record when selected and then continue on.

Then:
Put all the fields on your form like you normally would (including the CustID if you want it).

Done.
 
Hi there,

I tried your method, the option I think your talking about is 'Find a record on my form based on the value I selected in my combo box'

When I do that, its giving me the information of records I have of the current form, not the table which has all the addresses. I would very much prefer to have the address being displayed in a regular textbox.

Maybe I didn't follow what you meant properly. Eventhough I have been using access for a month or so, I still feel I am a beginner.

I am using Access 2000

Thanks.
 
The option you picked is correct.

The idea is that if you are in a form and choose a customer from the combobox you made it will take you to that paticular record which will include custname, address... if you have that info on your form.

its giving me the information of records I have of the current form, not the table which has all the addresses

Not sure what you mean here as the form is a reflection of the table information.
 

Users who are viewing this thread

Back
Top Bottom