Display forename & surname instead of id in combo box. (2 Viewers)

quit

New member
Local time
Today, 04:05
Joined
Mar 25, 2019
Messages
1
I've been trying to figure out how to do this but since I'm not familiar with Access terminology, it's proving to be difficult.

I will attach my database to this post, but the general setup of my database is as follows:
  • I have 3 tables; Mechanics, Customers & Appointments.
  • Each has an AutoNumber primary key called "id".
  • The Appointments table has "mechanic" & "customer" fields that reference the "id" fields from the other two tables.

I need to have a form setup to add records to each table. Creating these for Mechanics & Customers went very smoothly, but figuring out how to display something other than the "id"'s when adding an Appointments record did not. To clarify, I would like to see the Customer/Mechanic's forename and surname instead of their "id" when using the form labelled "Appointments Form".

Thank you!
 

Attachments

  • Garage.accdb
    1.8 MB · Views: 26

MajP

You've got your good things, and you've got mine.
Local time
Today, 07:05
Joined
May 21, 2018
Messages
8,527
The trick is to return the ID column and then the column you want to see.
Hide the first and show the second.
Something like
Code:
SELECT Customers.id, [surname] & ", " & [Forename] AS FullName FROM Customers;
Bound column: 1
Number of Columns: 2
Column Widths: 0";1"

First column is bound but it is hidden.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 07:05
Joined
May 21, 2018
Messages
8,527
To be clear it is hidden because it has a width of zero.
 

Minty

AWF VIP
Local time
Today, 12:05
Joined
Jul 26, 2013
Messages
10,371
Have a look at the customer drop down now.

Look at the combo properties and compare to the mechanics one for the differences.
 

Attachments

  • Garage.accdb
    652 KB · Views: 30

Users who are viewing this thread

Top Bottom