Results 1 to 5 of 5
  1. #1
    dcavaiani is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Posts
    10

    compact and repair of database messes up my report


    I can get my report to work, pulling in all the data fields with IIF control sources correctly - right after I make a small change to something and resave the report. All works fine UNTIL I do the repair, then fields in the report come up #Name errors? *** ACTUALLY, just CLOSING the database and reopening causes the Report to fail that way too.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    The query should pull all the data. try the IIFs there.
    maybe you don't need IIFs. Joining does the 'IF'

  3. #3
    dcavaiani is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Posts
    10
    Is it OK to slip another little question related to this same report? Currently, the report is run automatically as part of vba code and "picks" off the latest Invoice # (+1) from a table which has the last invoice # which WAS created, in a form which 'picks out' what is to be invoiced (how many weeks to be invoiced at this time). So, the Invoice print program report uses a dlookup to get the "last" invoice # JUST created and then prints it out. My question is that I wud like to have another macro which is "Reprint an Invoice", but I do not want to create a duplicate Invoice Report, yet how can I "ask" for the Invoice # this time on the report - to the question "which invoice do You want Reprinted"?

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    How are you initiating the current code, some sort of form that presents reports to pick from? That should be the method IMO. Then you add an option to provide a value and when that option is chosen, swap the report recordsource for a sql statement or query that has a parameter prompt for the value. Otherwise the report opens as it does now, with no prompt.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Bullschmidt's Avatar
    Bullschmidt is offline Freelance DB Developer
    Windows 10 Office 365
    Join Date
    Mar 2020
    Location
    USA
    Posts
    64
    I can get my report to work, pulling in all the data fields with IIF control sources correctly - right after I make a small change to something and resave the report. All works fine UNTIL I do the repair, then fields in the report come up #Name errors? *** ACTUALLY, just CLOSING the database and reopening causes the Report to fail that way too.
    Just a shot in the dark but maybe there is some form that needs to be open which is not open when you initially open the database.

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

Similar Threads

  1. Replies: 8
    Last Post: 07-09-2019, 12:51 AM
  2. Split Database | Compact and Repair
    By mrmmickle1 in forum Access
    Replies: 4
    Last Post: 07-27-2015, 08:53 AM
  3. Compact and Repair Encrpyted Database Problem
    By mrlddst in forum Security
    Replies: 16
    Last Post: 05-06-2014, 01:24 PM
  4. Will database auto compact and repair on the server?
    By squirrly in forum Programming
    Replies: 8
    Last Post: 04-15-2013, 02:37 PM
  5. Replies: 7
    Last Post: 11-11-2010, 11:16 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