Results 1 to 7 of 7
  1. #1
    kkbharat is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    34

    Macro statement.

    Hello everyone,



    Can anyone explain me the following statement from "Inventory to reorder Subform for Home" subform's onclick open form event macro from "Northwind 2007 Sample" Database.

    ="[ID]=" & [Product ID]

    To me it seems that because of the above expression it opens the "Product Details" form at the product clicked.

    Thanks

    Bharat

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Yes, that is filter criteria.
    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
    kkbharat is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    34
    Quote Originally Posted by June7 View Post
    Yes, that is filter criteria.
    Thanks for your response,

    Ok. But what do the quotation marks and the ampersand means.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    The quote marks define literal text. The ampersand is concatenation operator. This is concatenating literal text with a variable to construct an expression that will filter the form recordset.
    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
    kkbharat is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    34
    Quote Originally Posted by June7 View Post
    The quote marks define literal text. The ampersand is concatenation operator. This is concatenating literal text with a variable to construct an expression that will filter the form recordset.
    Hello June7,

    Thank you very much for your help. I tried according to what you suggested and fortunately it worked also but I am still confused about the syntax. I am not able to understand why it has to be enclosed in quotation marks. If you would like to add further I would be extremely thankful.

    Thank you very much. You have been a great help.

    Regards,

    Bharat

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    It's in quotation marks to define that the literal text is required, not the content of a variable. Literally need the field name "[ID]" not the value held by ID.
    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.

  7. #7
    kkbharat is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2017
    Posts
    34
    Quote Originally Posted by June7 View Post
    It's in quotation marks to define that the literal text is required, not the content of a variable. Literally need the field name "[ID]" not the value held by ID.
    Got it. Thank you very much. You have been a great help to me.

    Regards,

    Bharat

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

Similar Threads

  1. Replies: 2
    Last Post: 03-26-2015, 08:29 PM
  2. Replies: 6
    Last Post: 02-27-2014, 08:06 PM
  3. Macro If statement syntax error
    By euphonium01 in forum Macros
    Replies: 5
    Last Post: 10-15-2013, 07:30 AM
  4. IF Statement in a Macro
    By Elbows in forum Access
    Replies: 7
    Last Post: 10-11-2012, 12:46 PM
  5. How to issue a GRANT statement from a macro
    By xfp39024 in forum Access
    Replies: 2
    Last Post: 06-15-2012, 11:48 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