Hi,
i have a main table which consist of firstname and last name in 2 separate
fields. What i'm trying to do is that when selecting the name in the combo
box, I would like the full name to appear.
Eg
Field 1 -- Field 2 -- Combo box
John --Smith -- John, Smith
Can someone help please.
Thanks
Yogin
|
|
0
|
|
|
|
Reply
|
Utf
|
2/9/2010 3:51:01 PM |
|
Yogin -
Update the recordsource for the combo box, then adjust the properties of the
combo box to show what you want. You can show only the combined name using
column widths of 0" for the first two fields.
The recordsource query would be something like this:
SELECT FName, LName, FName & ", " & LName
From tableName
--
Daryl S
"Yogin" wrote:
> Hi,
>
> i have a main table which consist of firstname and last name in 2 separate
> fields. What i'm trying to do is that when selecting the name in the combo
> box, I would like the full name to appear.
>
> Eg
>
> Field 1 -- Field 2 -- Combo box
> John --Smith -- John, Smith
>
> Can someone help please.
>
> Thanks
>
> Yogin
|
|
0
|
|
|
|
Reply
|
Utf
|
2/9/2010 4:04:09 PM
|
|
Hi Daryl,
Thanks for the quick reply. I'm a complete newbie on Access and learning
with support from people on this forum.
When I click properties for this combo box to input the fomula, I cannot see
the recordsouce, I do see controlsource.
I tried to put the formula in there and I get an error.
This is what I put in controlsouce field of the combo box
SELECT FirstName, LastName, FirstName & ", " & LastName
From tblColleague
clearly i'm doing something wrong?
Can you help please
Thanks
Yogin
"Daryl S" wrote:
> Yogin -
>
> Update the recordsource for the combo box, then adjust the properties of the
> combo box to show what you want. You can show only the combined name using
> column widths of 0" for the first two fields.
>
> The recordsource query would be something like this:
>
> SELECT FName, LName, FName & ", " & LName
> From tableName
>
> --
> Daryl S
>
>
> "Yogin" wrote:
>
> > Hi,
> >
> > i have a main table which consist of firstname and last name in 2 separate
> > fields. What i'm trying to do is that when selecting the name in the combo
> > box, I would like the full name to appear.
> >
> > Eg
> >
> > Field 1 -- Field 2 -- Combo box
> > John --Smith -- John, Smith
> >
> > Can someone help please.
> >
> > Thanks
> >
> > Yogin
|
|
0
|
|
|
|
Reply
|
Utf
|
2/9/2010 5:08:01 PM
|
|
On Tue, 9 Feb 2010 07:51:01 -0800, Yogin <Yogin@discussions.microsoft.com>
wrote:
>Hi,
>
>i have a main table which consist of firstname and last name in 2 separate
>fields. What i'm trying to do is that when selecting the name in the combo
>box, I would like the full name to appear.
>
>Eg
>
>Field 1 -- Field 2 -- Combo box
>John --Smith -- John, Smith
>
>Can someone help please.
>
>Thanks
>
>Yogin
Yor table design may need some rethinking! Names are NOT unique: I once worked
at a university with a professor John W. Vinson. You should have a unique
PersonID primary key in the table.
That said, you can create a Query based on your table. In the first column of
the query grid put the unique ID field (this is what the combo should be
storing); in the second column put
FullName: [Field1] & ", " & [Field2]
to construct a string "John, Smith" (is that really what you want?? More
common would be "John Smith" or "Smith, John").
Put the two fields in the third and fourth columns in the order that you want
the names sorted, and select Ascending as the sort order.
You can then use this Query as the row source of your Combo Box. If you set
the column count to 2 and the ColumnWidths property to
0.0";1.5"
you will *see* the name, but the combo will store the ID.
--
John W. Vinson [MVP]
|
|
0
|
|
|
|
Reply
|
John
|
2/9/2010 5:49:08 PM
|
|
The SQL goes into the Row Source property since there is no Record Source on
combo boxes.
--
Duane Hookom
Microsoft Access MVP
"Yogin" wrote:
> Hi Daryl,
>
> Thanks for the quick reply. I'm a complete newbie on Access and learning
> with support from people on this forum.
>
> When I click properties for this combo box to input the fomula, I cannot see
> the recordsouce, I do see controlsource.
>
> I tried to put the formula in there and I get an error.
>
> This is what I put in controlsouce field of the combo box
> SELECT FirstName, LastName, FirstName & ", " & LastName
> From tblColleague
>
> clearly i'm doing something wrong?
>
> Can you help please
>
> Thanks
>
> Yogin
>
> "Daryl S" wrote:
>
> > Yogin -
> >
> > Update the recordsource for the combo box, then adjust the properties of the
> > combo box to show what you want. You can show only the combined name using
> > column widths of 0" for the first two fields.
> >
> > The recordsource query would be something like this:
> >
> > SELECT FName, LName, FName & ", " & LName
> > From tableName
> >
> > --
> > Daryl S
> >
> >
> > "Yogin" wrote:
> >
> > > Hi,
> > >
> > > i have a main table which consist of firstname and last name in 2 separate
> > > fields. What i'm trying to do is that when selecting the name in the combo
> > > box, I would like the full name to appear.
> > >
> > > Eg
> > >
> > > Field 1 -- Field 2 -- Combo box
> > > John --Smith -- John, Smith
> > >
> > > Can someone help please.
> > >
> > > Thanks
> > >
> > > Yogin
|
|
0
|
|
|
|
Reply
|
Utf
|
2/9/2010 6:33:01 PM
|
|
Yogin -
Sorry, the row source, not record source is where the SQL goes...
--
Daryl S
"Yogin" wrote:
> Hi Daryl,
>
> Thanks for the quick reply. I'm a complete newbie on Access and learning
> with support from people on this forum.
>
> When I click properties for this combo box to input the fomula, I cannot see
> the recordsouce, I do see controlsource.
>
> I tried to put the formula in there and I get an error.
>
> This is what I put in controlsouce field of the combo box
> SELECT FirstName, LastName, FirstName & ", " & LastName
> From tblColleague
>
> clearly i'm doing something wrong?
>
> Can you help please
>
> Thanks
>
> Yogin
>
> "Daryl S" wrote:
>
> > Yogin -
> >
> > Update the recordsource for the combo box, then adjust the properties of the
> > combo box to show what you want. You can show only the combined name using
> > column widths of 0" for the first two fields.
> >
> > The recordsource query would be something like this:
> >
> > SELECT FName, LName, FName & ", " & LName
> > From tableName
> >
> > --
> > Daryl S
> >
> >
> > "Yogin" wrote:
> >
> > > Hi,
> > >
> > > i have a main table which consist of firstname and last name in 2 separate
> > > fields. What i'm trying to do is that when selecting the name in the combo
> > > box, I would like the full name to appear.
> > >
> > > Eg
> > >
> > > Field 1 -- Field 2 -- Combo box
> > > John --Smith -- John, Smith
> > >
> > > Can someone help please.
> > >
> > > Thanks
> > >
> > > Yogin
|
|
0
|
|
|
|
Reply
|
Utf
|
2/9/2010 7:13:01 PM
|
|
Guy's, Thank You for your help.
The solution works well.
"John W. Vinson" wrote:
> On Tue, 9 Feb 2010 07:51:01 -0800, Yogin <Yogin@discussions.microsoft.com>
> wrote:
>
> >Hi,
> >
> >i have a main table which consist of firstname and last name in 2 separate
> >fields. What i'm trying to do is that when selecting the name in the combo
> >box, I would like the full name to appear.
> >
> >Eg
> >
> >Field 1 -- Field 2 -- Combo box
> >John --Smith -- John, Smith
> >
> >Can someone help please.
> >
> >Thanks
> >
> >Yogin
>
> Yor table design may need some rethinking! Names are NOT unique: I once worked
> at a university with a professor John W. Vinson. You should have a unique
> PersonID primary key in the table.
>
> That said, you can create a Query based on your table. In the first column of
> the query grid put the unique ID field (this is what the combo should be
> storing); in the second column put
>
> FullName: [Field1] & ", " & [Field2]
>
> to construct a string "John, Smith" (is that really what you want?? More
> common would be "John Smith" or "Smith, John").
>
> Put the two fields in the third and fourth columns in the order that you want
> the names sorted, and select Ascending as the sort order.
>
> You can then use this Query as the row source of your Combo Box. If you set
> the column count to 2 and the ColumnWidths property to
>
> 0.0";1.5"
>
> you will *see* the name, but the combo will store the ID.
> --
>
> John W. Vinson [MVP]
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
2/10/2010 7:18:02 PM
|
|
|
6 Replies
314 Views
(page loaded in 0.356 seconds)
Similiar Articles: Form with an unbound combo box. - microsoft.public.access.forms ...... CustPhone, LastName, FirstName FROM Customers ORDER BY LastName, FirstName; > >If the combo has ... I have an unbound combo box that I would like to be able to use to ... inserting multiple columns from combo list - microsoft.public ...I trying to pull employee firstName, lastName, and middleInitial from a table and insert ... That will work BUT the > only item that will show in the combo box - given the ... How to get two fields to show in a combo box - microsoft.public ...I have a bound combo box that is using 3 fields, CSM ID, CSM First Name, CSM ... LastName & ", " & FirstName FirstName & " " & LastName FirstName LastName If you had ... Change a text box to a combo box - microsoft.public.access ...A combo box bound to an EmployeeID foreign key column for instance might be set up as follows: RowSource: SELECT EmployeeID, FirstName & " " & LastName FROM ... How do I combine "First Name", "Last Name" ...... on the grid, add something like: FullName: [FirstName] & " " [LastName ... Combine First & Last Name for Combo Box I know how to combine the first and last name in a ... correzzione indirzzo errato - microsoft.public.accessti mando questa mail cos ti rimane in memoria la mia mail saluti luigi delle bici ... Display Combo Box Text Instead of Key in Table - microsoft.public ...... the query so that the rows appear in a meaningful order, in your case ordered by LastName then FirstName for instance. As regards your specific problem use a combo box ... How to populate a combo box with filtered data from a named range ...Column A=CompanyID B=ContactID C=Email D=FirstName E=LastName ... How to populate a combo box with filtered data from a named range ... Hi ... combo box on form to update different table - microsoft.public ...My name field on the form is defined as a combo box, with its control ... CustomerID in the first column and the CustomerName (actually, [LastName] & ", " & [FirstName ... Display apostrophe in Combo Box - microsoft.public.access.forms ...I have a combo box which displays the ... over time if InBasketName is > a combination ... message box after parsing FirstName ... A control is a text box, combo box, or ... Combining firstname and lastname in combo box DataBaseHi, i have a main table which consist of firstname and last name in 2 separate fields. What i'm trying to do is that when selecting the name in the combo box, I ... Combining firstname and lastname in combo box - WUGNET ForumsHi, i have a main table which consist of firstname and last name in 2 separate fields. What i'm trying to do is that when selecting the name in the combo box, I ... Combine First & Last Name for Combo BoxI know how to combine the first and last name in a form but I need it combined in the table so I can use it in a drop down combo box. I used SELECT How do I concatenate two fields (FirstName and LastName) in a ...I am using a combo box to select a persons name, which then displays all their details in other controls. I want to concatenate the firstname and lastname ... Combo box combine text from multiple fields - ComboBox Forum - ASP ...How can I bind the combo box like this so i can see the title: FirstName Lastname in the text field. ... Related resources for "Combo box combine text from multiple ... 7/20/2012 2:13:19 PM
|