Results 1 to 6 of 6
  1. #1
    Desmondo is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Location
    Gold Coast, Australia
    Posts
    6

    Hi all, a quick query...


    I have an expression in a query which has text and a field i.e. Expr1:"this is the"&[School] in which case the school shows as the primary key number instead of the full text name. As soon as I remove the text from in front of the [] it reverts to the text name. I am sure this must be something simple I have overrlooked but can't seem to get it.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    That's because Lookup aliases are not carried into fields created with an expression. You need to join the tables on the PK/FK and then all the related info will be available, including the field that actually has the school name.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Desmondo is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Location
    Gold Coast, Australia
    Posts
    6
    Thanks for your reply June7. Due to the amount of cross referenced data required I am using 2 query's to make this new query where the PK/FK have been joined and all expressions work except this one. The [school] field is in one of those joined query's and when the new query is viewed as a datasheet the school shows up as the full name not the PK. When I create an expression in this new query e.g. Expr1: [school] it also shows as the full name (how I need it) however, as soon as I place quoted text in front of it, e.g. Expr1: "This is the"&[school] it reverts to displaying the PK. I hope I am explaining this well enough. In the past I have always managed to find the answers somewhere online however, this is the first time I have had to try to explain a problem to someone.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    My comment is the same. Either include the school name field in other query so it will also be available in this new query or include the table with the school name in this query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Desmondo is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Location
    Gold Coast, Australia
    Posts
    6
    Quote Originally Posted by June7 View Post
    My comment is the same. Either include the school name field in other query so it will also be available in this new query or include the table with the school name in this query.
    Thanks so much again June7 for attempting to assist with my stupidity. I am usually very careful with my tables etc and couldn't quite work out this one. You're response verified I had done that side right however, something was still amiss so I kept checking things and found it to be a Data Type Mismatch between the original school list table and the table that stores the school from a combo lookup. The field in my list was TEXT and my combo stored field was NUMBER... So simple, I can't believe I missed it ! Dugghhh ! Cheers

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I am not understanding how that was the cause of your issue but if you feel it is resolved, congratulations.

    Also occurred to me that instead of putting that text before the field in query, put it in a label on form or report and textbox bound to the field next to label.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Quick Return Query
    By worldwidewall in forum Access
    Replies: 2
    Last Post: 03-07-2012, 07:04 PM
  2. Quick SQL Query question.
    By Suoipoc in forum Access
    Replies: 4
    Last Post: 09-06-2011, 09:10 PM
  3. New eyes on a quick update query
    By Lorlai in forum Queries
    Replies: 3
    Last Post: 07-14-2011, 09:51 AM
  4. 3 Quick Q's
    By anoob in forum Access
    Replies: 5
    Last Post: 01-14-2011, 10:42 AM
  5. quick query syntax questions
    By cowboy in forum Access
    Replies: 6
    Last Post: 02-03-2010, 06:10 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