Do I need a Control Source?

chadz777

New member
Local time
Today, 11:20
Joined
Mar 30, 2008
Messages
7
I have a drop down list of Last name and first name.

I want this to be the only unlocked feature on the page. When a name is selected the other information is shown (the persons cc#, Exp date, phone number, email etc.)

I am almost sure its a control source, but i'm not 100% as i'm relatively new to Access..

Another issue I would like to know is how to show the Last Name, First Name in the selected drop down after its selected, currently its only showing the Last name.

Thanks in advance
 
If you just want to display the selected person's cc#, exp date etc., you can bring in the values using a combo box (is your drop down a combo box or a list box?). You would add unbound textbox controls to your form. Your users cannot edit the information in the unbound controls if they are populated using the following technique. For the control source for the textbox control you would enter an expression like this:

=mycomboboxname.column(x)

where x= the column # of the field you want displayed.

For example, if the row source of your combo box looked like this:

SELECT recordID, LastName, FirstName, ccNo, phone
FROM yourtablename

recordID is in column zero, LastName in column 1 and so forth.


As to your second question, to display both the last name and first name, you need to concatenate the two fields. You would modify the combo boxes row source as follows:


SELECT recordID, LastName &" "& FirstName, ccNo, phone
FROM yourtablename

This will display the LastName followed by a space and then the Firstname, the concatenated result would be in column1, ccNo will now be column 2

If you want to have a comma and a space between the last and first names, just add a comma between the two " " as below

SELECT recordID, LastName &", "& FirstName, ccNo, phone
FROM yourtablename
 
I appreciate the help ;) going to try and implement it now
 
Good luck; let me know if you additional help.
 
Thanks, Got it working! Appreciate the help...

just needed to do some formatting and it looks all good now!
 

Users who are viewing this thread

Back
Top Bottom