Results 1 to 5 of 5
  1. #1
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141

    Get Specific Report by clicking a button in form

    I have created 2 tables -

    Main -
    1-ID - Autonumber
    2-Company Name
    3-Subject

    Child
    1-ID - Autonumber
    2-MainID - connected to Table Main - ID
    3-RemarkDate
    4-Remarks



    Based on these I created the following:
    1-Main Form - with all the data entry
    2-Report - shows company name, ID, listed all the dates and remarks under the Main ID

    On the form, I need a button to get for me the specific report for Main ID 1.

    What I did was create a query where it ask the ID Number. If you put let say "10", all the details for 10 taken from the Child Table will appear. This is what I am trying to eliminate. on the form, I am already in ID 10, when I press the button for the report, it still ask me what ID number to get.

    I need that since I am already in the form 10, when you click the report button, report 10 will appear and not ask as mentioned above.

    Thank you for the assistance.

    Trident

  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,530
    Replace the criteria in the query that asks for the ID number with a reference to a control on your form. Something like:
    Forms!NameOfMainForm.ID
    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
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141
    Dear Bob,

    I tried the suggestion, but no improvement.

    1-I placed the Forms!formname.ID, in the query and when opened, it is still asking for the ID
    2-created a report, made a button in the main form and placed the Forms!FormName.ID in the event, still same problem, asking for the ID when clicked.

    I think this should be made thru VBA, which unfortunately, i have poor programming skill.

    Thank you for your assistance.

    Trident.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Please post SQL statement of your query.

  5. #5
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Make sure that "ID" is the correct name for the field on the form. If it is a combobox, make sure that it is the first column. Otherwise, in the macro that opens the report, add a "WHERE" condition and say : reportfieldname (ID?) = Forms!formname!formfieldname

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

Similar Threads

  1. Replies: 2
    Last Post: 09-15-2015, 03:08 AM
  2. Replies: 2
    Last Post: 06-03-2014, 12:12 PM
  3. Replies: 9
    Last Post: 08-20-2013, 09:59 AM
  4. Replies: 3
    Last Post: 07-11-2013, 11:52 AM
  5. Replies: 4
    Last Post: 10-05-2011, 01:28 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