Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    23

    Question Unanswered: Open a query based on data from another table?

    I was wondering if anyone could help? I have one form with a field called clientcode and table (tblclientinfo) with a field called clientref.

    I would like a button on my form that pulls the relevant data across based on matching clientcode-clientref.

    Its just the WHERE in my select query thats giving me trouble, I thought it might be something like:

    WHERE ("CLIENTREF.TBLCLIENTINFOGLA","CLIENTREF = '" & [CLIENTCODE]& ""))

    or

    WHERE (((CENTRALAPP.ClientCode)=(TBLCLIENTINFOGLA.client ref)));


    I managed it okay with a report using VB

    stLinkCriteria = "[clientref]=" & "'" & Me![clientref] & "'"

    Any help would be great.

    Dave

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    In:

    ("CLIENTREF.TBLCLIENTINFOGLA","CLIENTREF = '" & [CLIENTCODE]& ""))

    What is the purpose of CLIENTREF.TBLCLIENTINFOGLA? It's just hanging there with no criteria, I suspect that is confusing access. Also, you're missing a closing single quote for [CLIENTCODE], and the closing double quote is in the wrong place.

    If the string mentioned for your stLinkCriteria worked, just pop a WHERE in front of it and call it good:

    "WHERE [clientref]='" & Me![clientref] & "'"
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •