chadz777
03-30-2008, 02:22 PM
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
jzwp22
03-30-2008, 07:07 PM
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
chadz777
03-31-2008, 07:45 AM
I appreciate the help ;) going to try and implement it now
jzwp22
03-31-2008, 08:26 AM
Good luck; let me know if you additional help.
chadz777
03-31-2008, 08:58 AM
Thanks, Got it working! Appreciate the help...
just needed to do some formatting and it looks all good now!