Results 1 to 5 of 5
  1. #1
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126

    Where expression help

    I have a form that shown drivers race data. A button on that form bring up a report of driver details.
    The problem I a having is my where clause brings up a prompt to enter the drivers ID. I would like to eliminate the prompt and open the report directly.

    My code is, Where=
    Code:
    ="[DriverID]=" & "[DriverHistoryF].[DriverID]"
    Any help please.

    Jim O

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Perhaps:
    WHERE "[DriverID]=" & Me.[DriverID]
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Not a lot to go on.....

    One thing is that the reference to [DriverID] should not be in quotes - the quotes turn the reference to a string.
    Another is that you are referencing the form wrong. A fully qualified reference to a control on a form would be: Forms![DriverHistoryF].[DriverID]

    Maybe try
    Code:
    "Where [DriverID]=" & Forms![DriverHistoryF].[DriverID]

  4. #4
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126
    ssanfu,

    Thank you for the help. That works fine.

    Jim O

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Happy to help....

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

Similar Threads

  1. Replies: 2
    Last Post: 05-12-2016, 04:31 PM
  2. Replies: 4
    Last Post: 05-03-2016, 01:51 PM
  3. Replies: 5
    Last Post: 09-25-2013, 09:35 AM
  4. Replies: 2
    Last Post: 11-20-2012, 03:21 AM
  5. Replies: 4
    Last Post: 10-26-2012, 12:49 AM

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