Creating an Autolookup Query

J

JCook

I want access to automatically fill in several fields based on a unique
customer number that the user will enter. I have a table set up with all of
the information I need to retrieve but I don't know which type of box on my
form I need to use to have access automatically fill in the relevant fields.
If I use a combo box, I have to click on each field for the data to be
retrieved. If I use a text box, my SQL statement doesn't work in the
expression window. Here is an example of my SQL statement:

SELECT Customers.BillingAddress
FROM Customers
WHERE ((([CustomerID])=([Customers].[CustomersID])));

Any help would be appreciated.
 
J

Jeff Boyce

When you say "fill in several fields", it could mean you want to copy data
from one table into another table. Is this what you are trying to do?
(hint: not a good idea!)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

JCook

What I'm trying to do is display a customer name, address and phone number on
an invoice. If there is a way to do that without copying the information
from the table, then that would work. Otherwise, I guess that is what I'm
trying to do. Thanks.

Jeff Boyce said:
When you say "fill in several fields", it could mean you want to copy data
from one table into another table. Is this what you are trying to do?
(hint: not a good idea!)

Regards

Jeff Boyce
Microsoft Office/Access MVP

JCook said:
I want access to automatically fill in several fields based on a unique
customer number that the user will enter. I have a table set up with all
of
the information I need to retrieve but I don't know which type of box on
my
form I need to use to have access automatically fill in the relevant
fields.
If I use a combo box, I have to click on each field for the data to be
retrieved. If I use a text box, my SQL statement doesn't work in the
expression window. Here is an example of my SQL statement:

SELECT Customers.BillingAddress
FROM Customers
WHERE ((([CustomerID])=([Customers].[CustomersID])));

Any help would be appreciated.
 
J

Jeff Boyce

Access is a relational database. If you already have the data recorded
once, don't bother storing it again in another table (it just causes you
headaches, like trying to figure out which table has the CORRECT data?!).

Use a query to join your two tables of data, then build your report based on
that query.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

JCook said:
What I'm trying to do is display a customer name, address and phone number
on
an invoice. If there is a way to do that without copying the information
from the table, then that would work. Otherwise, I guess that is what I'm
trying to do. Thanks.

Jeff Boyce said:
When you say "fill in several fields", it could mean you want to copy
data
from one table into another table. Is this what you are trying to do?
(hint: not a good idea!)

Regards

Jeff Boyce
Microsoft Office/Access MVP

JCook said:
I want access to automatically fill in several fields based on a unique
customer number that the user will enter. I have a table set up with
all
of
the information I need to retrieve but I don't know which type of box
on
my
form I need to use to have access automatically fill in the relevant
fields.
If I use a combo box, I have to click on each field for the data to be
retrieved. If I use a text box, my SQL statement doesn't work in the
expression window. Here is an example of my SQL statement:

SELECT Customers.BillingAddress
FROM Customers
WHERE ((([CustomerID])=([Customers].[CustomersID])));

Any help would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top