Filling In data - I need a Guru!

T

TwinDad

I have a Customer Tracking Form (source: tblCustComplaint). The Combo Box
that gets the LocationID From the tblCustomerData using a SQL Query

I would like to Auto-Fill the other text boxes with the Company Name,
Address, City, State, Zip, Phone#, etc. from the tblCustomerData.

Is there a "Simple Way" to fill this in?

-The Novice
 
T

Tony

When the combo box get's it info, set up your listboxes for the address,
city, state, zip, etc... change like so by putting sql in the Row source:

SELECT tblCustomerData.Address, tblCustmerData.LocationID FROM
tblCustomerData WHERE (((tblCustomerDAta.LocationID) Like
forms!FormName!ComboName));
 
K

Klatuu

Why not use a query that joins tblCustComplaint and tblCustomerData and use
that as the recordsource for your form? If you don't want users modifying
the data in tblCustomerData, set the controls for those fields to Locked =
True and Enabled = False.
 
T

TwinDad

Klatuu,

I just need to see the information. the reason that I am using "TEXT Box"
are for patrons that may call in a complaint that do not exist in our
customer database.

I am writting redundant data to the tblCustComplaint for customers other
than our existing ones. (Make Sense?)

I am just looking at pre-filling the information for customers that already
exit.

Thanks,

Charlie
 
L

Lynn Trapp

Your ComboBox RowSource can contain as many columns as you need from your
CustomerData table. You can then set the individual text boxes equal to the
needed column from the ComboBox. Remember that a ComboBox is Zero Based,
thus the first column in Column(0). So, you would set the text boxes
something like this on the change event of the ComboBox:

Me.CustomerName = Me.YourComboBox.Column(1)


--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html
 
T

TwinDad

Tony,

I need to be able to have users add customers that may not exist in the
Customer Table. with the list box this prevents the entry of information if
they do not exist.

this worked great until i tried to enter information.

-The Novice
 
K

Klatuu

What I proposed will do exactly that.

TwinDad said:
Klatuu,

I just need to see the information. the reason that I am using "TEXT Box"
are for patrons that may call in a complaint that do not exist in our
customer database.

I am writting redundant data to the tblCustComplaint for customers other
than our existing ones. (Make Sense?)

I am just looking at pre-filling the information for customers that already
exit.

Thanks,

Charlie
 
T

TwinDad

Lynn,

I created an event procedure in "Properties - On Change" added the code, but
it does not seem to work, Nothing appears.

Am I doing something wrong?

-The Novice
 
T

TwinDad

Klatuu,

I must be really dense, How does the Address Information get populated?

Charlie
 
T

TwinDad

Lynn,

this is what I have. I created a query and am using this data. The tables
that I want to populate is the tblCustComplaint, I just need to read from the
tblCustomerData.

Thanks in Advance,

Charlie

SELECT tblCustComplaint.PKEY, tblCustComplaint.Date,
tblCustComplaint.Customer_Number, tblCustComplaint.Contact_Name,
tblCustComplaint.Company_Name, tblCustComplaint.Address,
tblCustComplaint.City, tblCustComplaint.State, tblCustComplaint.Zip,
tblCustComplaint.PhoneNumber, tblCustComplaint.AreaSupervisor,
tblCustComplaint.NatureOfComplaint, tblCustComplaint.Driver,
tblCustComplaint.Trailer, tblCustComplaint.Tractor, tblCustComplaint.Route,
tblCustComplaint.Comments, tblCustComplaint.Customer,
tblCustComplaint.Resolution, tblCustComplaint.Closed,
tblCustomerData.custname, tblCustomerData.address, tblCustomerData.city,
tblCustomerData.state, tblCustomerData.zip, tblCustomerData.[phone#]
FROM tblCustComplaint INNER JOIN tblCustomerData ON
tblCustComplaint.Customer_Number = tblCustomerData.custnumber;
 
T

TwinDad

Lynn,

this is what I have. I created a query and am using this data. The tables
that I want to populate is the tblCustComplaint, I just need to read from the
tblCustomerData.

Thanks in Advance,

Charlie

SELECT tblCustComplaint.PKEY, tblCustComplaint.Date,
tblCustComplaint.Customer_Number, tblCustComplaint.Contact_Name,
tblCustComplaint.Company_Name, tblCustComplaint.Address,
tblCustComplaint.City, tblCustComplaint.State, tblCustComplaint.Zip,
tblCustComplaint.PhoneNumber, tblCustComplaint.AreaSupervisor,
tblCustComplaint.NatureOfComplaint, tblCustComplaint.Driver,
tblCustComplaint.Trailer, tblCustComplaint.Tractor, tblCustComplaint.Route,
tblCustComplaint.Comments, tblCustComplaint.Customer,
tblCustComplaint.Resolution, tblCustComplaint.Closed,
tblCustomerData.custname, tblCustomerData.address, tblCustomerData.city,
tblCustomerData.state, tblCustomerData.zip, tblCustomerData.[phone#]
FROM tblCustComplaint INNER JOIN tblCustomerData ON
tblCustComplaint.Customer_Number = tblCustomerData.custnumber;
 
T

TwinDad

Lynn,

this is what I typed in the "Change"

Private Sub Company_Name_BeforeUpdate(Cancel As Integer)
Me.Company_Name = Me.Customer_Number.Column(1)
End Sub
 

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