Results 1 to 7 of 7
  1. #1
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215

    Open Report linked to Query Issue

    So I have an Unbounded Form with various inputs. I have a query, SearchQ, that takes these inputs for specific criteria.

    If I run the query, the query itself pops up in datasheet view - which is useless to me since I want to generate a report off of this specific search.

    When I run the query, and then try to run the Report, I get an error message - as such. NOTE: When I close out of the query itself the error goes away most of the time.

    Click image for larger version. 

Name:	Question.jpg 
Views:	14 
Size:	104.7 KB 
ID:	17403 I created a macro that runs the query -> closes the query -> closes the form -> opens report. I tried creating two commands that also just runs query -> closes query AND ANOTHER button that closes form -> opens report.



    I keep getting this same error no matter what I do and I have no idea why. The error might be linked to a security issue - but I honestly dont know.

    Thanks

    PS - I KEEP GETTING THIS ERROR IF I CLOSE THE FORM AND QUERY, OR NOT. My report just isn't popping up anymore....

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    There is no need to 'run' query, just open report that uses the query as RecordSource.

    The unbound controls are to input filter criteria? How are you applying the parameters?

    Are you using dynamic parameters in query?

    BTW, advise no spaces or special characters/punctuation (underscore is exception) in naming convention. The # character is bad. Better would be RefNum_ID or RefNo_ID or RefNoID.
    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
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    The unbound form is there to take input for the query.

    ie

    [forms]![SearchF]![ComboBox2] or something.

    Then, after you perform the multi-field search criteria... to be able to open a report with records relevant to the search criteria.

    It's not working for me. I have the query as the record source of my report so Im not sure what's wrong.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Example of report based on dynamic parameterized query referencing form controls for input http://www.datapigtechnologies.com/f...mtoreport.html

    However, if Ref# ID is a number, this method will probably not work as desired. For VBA alternative, review http://www.allenbrowne.com/ser-62code.html
    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
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    I haven't been able to implement it yet, but that first link you sent is exactly what I was looking for. It's a bit more complicated than just linking to a query and setting the value of the combo box to regular table values is what I believe was causing my issues. I hope this works tomorrow!

    Thanks

  6. #6
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    Unfortunately, this didn't work today.

    First off, I have multi-value fields in my Main table. I am not going to change this. I am confident one can work around multi-value fields. I have had success so far (with a headache).

    I am doing everything that he is doing in the video. The ONLY thing that changes is that when I link to my ContentsT table, it creates a new field in the query (as you can see) called Content.Value - it gets rid of whatever I inputted originally in the Content field in the query and replaces and adds with that new field.

    This is something that happens with multi-value fields. It calls upon a particular value of the Contents table. I get an error (the same error as before) when trying to execute the "Run Report" command.

    Here are the images of what I have below. It is worth noting that I created a macro for the Run Report command to close out the form and open the report itself.

    Click image for larger version. 

Name:	RecordSource.jpg 
Views:	9 
Size:	220.7 KB 
ID:	17415Click image for larger version. 

Name:	Query.jpg 
Views:	9 
Size:	128.8 KB 
ID:	17416Click image for larger version. 

Name:	Macro.jpg 
Views:	9 
Size:	34.5 KB 
ID:	17417Click image for larger version. 

Name:	Error.jpg 
Views:	9 
Size:	37.1 KB 
ID:	17418

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Ouch! I NEVER use multi-value fields so I have little experience with them. I've never tried to apply filter criteria to multi-value field nor build report with them. I don't know why that error is triggered. You may be on your own here.
    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.

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

Similar Threads

  1. Help on report to open form to open query...
    By saseymour in forum Programming
    Replies: 13
    Last Post: 07-16-2013, 08:11 AM
  2. Replies: 1
    Last Post: 01-22-2013, 09:51 AM
  3. Replies: 7
    Last Post: 09-06-2012, 02:08 PM
  4. Linked Table query performance issue
    By patneel in forum Access
    Replies: 1
    Last Post: 07-31-2012, 12:09 PM
  5. Help! FE and BE linked tables issue
    By GraemeG in forum Access
    Replies: 1
    Last Post: 04-03-2011, 04:31 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