Results 1 to 6 of 6
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 7 Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Using the Lookup

    If I have set a table to Look up, and pull from a list box, and set the Table I want it to look up info from.....I have a separate table with the city in one column and the state in another. I want it displayed this way, when you look up, but it is combining the two into one when it is set as the row source. Is it possible to add two fields to my TBL_Information, so that when I lookup using my TBL_Locatoin the city and the state are displayed in a different column?

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I'm a little confused on what you want to do.

    Would you provide:
    table names
    form name
    list box name and
    list box record source (SQL).

    Is there any event code for the list box?

    Where do you want the city name and state name to be displayed? Form? Text boxes?

  3. #3
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 7 Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    I have no event code set for this. I am wanting the city, and state to be displayed as city,state on my form, but it is not displaying. I am attaching a .zip of my database and see if that will provide further insight.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I changed the form record source and the combo box row source to queries.
    While you can use tables as the sources, you cannot filter or sort the records.

    I added the state abbreviations and added four records.......

  5. #5
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 7 Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    That is exactly what I was wanting to do! So the only way to combine the City & State Field if they are in seperate columns is through a SQL statement like:

    Code:
    SELECT TBL_Location.id, [City] & ", " & [State] AS CitySt
    FROM TBL_Location

  6. #6
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    While concatenating the two fields in the query is probably the better/easier way, you could also concatenate the two fields using a control (text box) on a form/report.

    If the form/report record source has two separate columns you want to combine, in the Control Source you would use "= [City] & ", " & [State] " (without the quotes)

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

Similar Threads

  1. Lookup or new
    By asmith in forum Forms
    Replies: 6
    Last Post: 09-29-2010, 12:58 PM
  2. lookUp
    By Balen in forum Access
    Replies: 2
    Last Post: 08-08-2010, 02:09 AM
  3. LookUP Help
    By DaveyJ in forum Forms
    Replies: 6
    Last Post: 06-25-2010, 11:27 PM
  4. Many To Many lookup
    By todavy in forum Forms
    Replies: 0
    Last Post: 12-15-2009, 09:27 AM
  5. Lookup
    By neon'00 in forum Forms
    Replies: 2
    Last Post: 04-14-2007, 01:19 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