Results 1 to 2 of 2
  1. #1
    Jon-G is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2011
    Posts
    15

    Combo Box Contacts Lookup with concatenation - Pls help!

    Hi,
    Im having a problem with a combo box (cbClientNombre) Im trying to use to pull information from a contact table to a form associated with a plots table.



    I have used the wizard and built the control, and at the moment when I drop down the list I can see the data from the contacts table.

    Im pulling back all fields in the table and have set the column widths to 0 for the fields other than salutation, name and surname that this query is pulling back. I want to use the other fields to populate text boxes on my form with the telephone number. I have also created a numeric field (called client) in the Plots table, which stores the ID from the Contacts table, and created a relationship between the two. Currently the Row Source query looks like this (as created by the wizard)

    Code:
    SELECT [tblClientes].[ClienteID], [tblClientes].[Saludo], [tblClientes].[Apellido], [tblClientes].[Nombre], [tblClientes].[Telèfono], [tblClientes].[Email], [tblClientes].[Numero_de_casa], [tblClientes].[Calle], [tblClientes].[Zona], [tblClientes].[Colonia], [tblClientes].[Ciudad], [tblClientes].[Departamento], [tblClientes].[Codigo_postal] FROM tblClientes ORDER BY [Apellido], [Nombre];
    The first problem that I have is that when I select a client from the contacts table, I just get the salutation displayed in the combo and nothing more. I have tried playing around with the column widths and column count properties to no avail.

    I'd also like to be able to concatenate the information from the salution name and surname fields to display in the combo box after the selection has been made. I tried the following but Access throws an error saying there are characters detected after the SQL statement

    Code:
    SELECT [tblClientes].[ClienteID], [tblClientes].[Saludo] & " " & [tblClientes].[Nombre] & " " & [tblClientes].[Apellido] As [Buyer Full Name], [tblClientes].[Telèfono], [tblClientes].[Email], [tblClientes].[Numero_de_casa], [tblClientes].[Calle], [tblClientes].[Zona], [tblClientes].[Colonia], [tblClientes].[Ciudad], [tblClientes].[Departamento], [tblClientes].[Codigo_postal] FROM tblClientes ORDER BY [Apellido];
    I have also tried adding the following to the control source of the 'telephone number' unbound textbox on the same form, but this didnt work:

    Code:
    =[cbClientNombre].[Column]([5])

    I have searched and searched trying to find an example of how to do this correctly (which I thought would be all over the net!)

    Any help would be greatly appreciated!

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    Jon-G

    ...Currently the Row Source query looks like this (as created by the wizard)

    Nothing in box to view!
    Can you post the RowSource?


    ...I tried the following but Access throws an error saying there are characters detected after the SQL statement

    Nothing in box to view!
    Can you post the SQL?


    Lastly,

    ...=[cbClientNombre].[Column]([5])

    try, =[cbClientNombre].Column(5)

    All the best,

    Jim

Please reply to this thread with any new information or opinions.

Similar Threads

  1. lookup query and display in combo box?
    By Jackie in forum Programming
    Replies: 6
    Last Post: 04-05-2011, 08:46 PM
  2. Month/Year lookup for combo box
    By Buakaw in forum Forms
    Replies: 7
    Last Post: 03-01-2011, 09:49 PM
  3. Combo Lookup
    By b123 in forum Forms
    Replies: 1
    Last Post: 02-24-2011, 11:24 AM
  4. Combo box lookup confusion
    By redpenner in forum Forms
    Replies: 5
    Last Post: 08-19-2010, 08:45 PM
  5. Query and Concatenation
    By Try2Live4God in forum Programming
    Replies: 2
    Last Post: 05-25-2010, 03:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums