Results 1 to 12 of 12
  1. #1
    KevinH is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    18

    Trouble viewing correct data

    I am new to Access and having a hopefully simple problem, I want to have the first and last name appear in a table as text. Here is what I have set up.



    Form with combo box which pulls name from a query which ties first and last name together

    Query is created from table which displays customer contacts, CustomerID is autonumber and primary key

    The table the above form reports to pulls the CustomerID number instead of the text I want displayed.

    How can I have this table display first and last name from a table vs the coresponding primary key number?

    Thanks,
    Kevin

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are you using the ComboBox to "look up a record" in your form's RecordSource?

  3. #3
    KevinH is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    18
    I'm using a combo box to lookup a column in a query that has combined first and last names. I'd rather use this combo to lookup the names from my table and do the combine without this added query then display the name in the table associated with this form instead of the primary key which shows up as a number.

    Thanks

  4. #4
    Max D's Avatar
    Max D is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2009
    Posts
    63
    Its a little bit tricky in Access, and I personally don't like the way it is.

    Lets assume your query returns 2 columns - ID and Name.

    Go Format/Column count and set it to 2.
    Set Format/Column widths to 0;5 - it will hide the first column.I hope u've got an idea :-)

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You can bind your form to a query (and you should!) that joins the two tables and then displaying the name just happens when you change the CustomerID. There is *no* penalty for doing it this way! A query does not take up any robb in the db other than that necessary for the SQL string that defines the query. The name should not be in more than one table, just the CustomerID ForeignKey.

  6. #6
    KevinH is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    18
    That helped on the form to display only the names, but when I go to the table the name in text is displayed as the corresponding ID number for this record (customer), how can I convert this to show the text instead of primary key?

  7. #7
    Max D's Avatar
    Max D is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2009
    Posts
    63
    You can't make the very table look different. But you can create a table-form (Create > More forms > Datasheet) and make the same trick for the field there.

    This form will look as a table, but you can alter it the way you like.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are you talking about looking directly at the table in datasheet view? If you need the name visible then just look at the table with the query. Your users should never be looking directly at a table anyway.

  9. #9
    KevinH is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    18
    The joys of learning something new! I have my forms tied to a table, maybe one reason I'm having problems? I'll create a query and tie it to the form, I'll let you know how things work.

    Thanks,

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    We'll be waiting for the results. Thanks.

  11. #11
    KevinH is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    18
    I had actully had tied this to a query, with some playing around I changed the bound column to 2. This allowed the column I wanted to show up in my table as text to work. Seems to be working now.

    Thanks!

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help. Have fun with the rest of the project.

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

Similar Threads

  1. Viewing ending zeros in decimal
    By duecesup in forum Reports
    Replies: 0
    Last Post: 12-11-2008, 02:45 PM
  2. Access 2.0 Viewing Code
    By wollydog in forum Access
    Replies: 0
    Last Post: 12-03-2008, 07:50 AM
  3. Hi ! Im having time trouble
    By gayano in forum Access
    Replies: 0
    Last Post: 06-28-2007, 12:10 AM
  4. not correct running total in group
    By cmk in forum Reports
    Replies: 1
    Last Post: 12-06-2006, 05:56 PM
  5. Having trouble with dates in my Data Base!!!!
    By BigPhil in forum Queries
    Replies: 4
    Last Post: 02-15-2006, 12:47 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