Results 1 to 4 of 4
  1. #1
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276

    Open Report Problem - On Click A Field With Company Name

    I am trying to add a code on a text box on a continues form, this form shows the list of company names.


    I want to click on the text Box "CoNme" to open the Report Of The Company
    The Name Of The Report Is "GP2" & the Control Source is "PurCompanyName"


    DoCmd.OpenReport "GP2", acViewPreview, , , "[PurCompanyName]=""" & [CoNme] & """"

    Need Help to Fix Code

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    One too many commas:
    DoCmd.OpenReport "GP2", acViewPreview, , "[PurCompanyName]=""" & [CoNme] & """"
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,942
    Quote Originally Posted by aamer View Post
    I am trying to add a code on a text box on a continues form, this form shows the list of company names.
    I want to click on the text Box "CoNme" to open the Report Of The Company
    The Name Of The Report Is "GP2" & the Control Source is "PurCompanyName"


    DoCmd.OpenReport "GP2", acViewPreview, , , "[PurCompanyName]=""" & [CoNme] & """"

    Need Help to Fix Code
    Intellisense should do it?
    That is what I rely on. I am not experienced enough to know how many parameters are in a command?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    Thx Works Like A Charm

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

Similar Threads

  1. Replies: 4
    Last Post: 12-09-2015, 09:02 AM
  2. Replies: 3
    Last Post: 07-22-2014, 11:37 AM
  3. click on report to open more information
    By benjammin in forum Reports
    Replies: 3
    Last Post: 10-08-2012, 11:36 AM
  4. Report does NOT open on BUTTON CLICK
    By taimysho0 in forum Programming
    Replies: 3
    Last Post: 01-04-2012, 02:38 PM
  5. Replies: 7
    Last Post: 01-12-2011, 08:59 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