Reports in .accdr

duvenhlc

Registered User.
Local time
Tomorrow, 04:34
Joined
Feb 4, 2008
Messages
54
Hi

Can someone please tel me why do I get a run time error (only on the reports) if I convert my database to a .accdr database. If I change it back to .accdb it works fine.

Regards

Lance
 
what is the error you get? also, sometimes if you have "invalid" characters in your FOLDER names (nothing to do with the access app really) then this can cause issues. these "invalid" characters are practically anything that isn't a letter or number.
 
well accdr is a runtime version - do you not get a debug error with the full version?
 
I think I know what is the problem, not sure how to fix it. I am using a cross tab query for the report. It will change the the report based on the amount of headings. I think there is a problem with my code, maybe not compatable.

Lance
 
instead of using a cross tab query, use a standard query with fixed fields, and then link the fixed fields to the report. If you have months across the top, and you have a trailing 12 or thirteen month query, then that is easy to write a query which puts each trailing twelve months in the correct field.

sportsguy
 
Nope, that will not work. The output is not fixed and can vary. It is not month based, byt KPA's that the user can define. It can be whatever they need. That is the reson for the Cross tab.

Lance
 
did you check for invalid characters in the folder names as per suggestion from post 2?
 
Thanks, I think it may be another problem with the code. I have downloaded some examples from the forum, and it is doing the same. What happen is, I have a report that is based on a crosstab query. It will expand depending on the info for the report. All work 100% as I need it to do, if I convert this database into the 2007 version, I get "type mismatch".

I do not understand it. I have attached one of the DB's I downloaded from the forum; please note it is not mine. But the problem is the same.

Lance
 

Attachments

ok. i see. i get the same error. unfortunately i don't know (anything) about recordsets, so don't know if there's something funny for runtimes.... google is your friend though, i've often found my answer there if not here.
 
Thanks, at least I know now I am not crazy (almost there) I do not know why it change between the two versions.

Thanks
 
to go back to the beiginning - the only difference between runtime and full access - is that when access crashes, in runtime the app stops - but in full version you get the debug/end choice.

so in normal mode - are you still getting unhandled errors - if so thats the problem - nothing to do with the runtime, of itself
 
ok, so, i've added error handling into your report open event. what it is doing now is returning a total of 11 errors throughout your code in access 2007 (most of them from Detail_Format).

i may not know much about record sets, but one rule of thumb is to ALWAYS have an error handler. please see attached for error-handling added to your sample, and a screenshot of all the error messages (saved in order of them appearing). the last error triggered on Report_Close.

most of them were error #91 - Object variable or With block variable not set.

and i don't know what that means, but at least you have another few clues as to what might be going on.

i'd say access 2007 is probably less forgiving of incorrect/sloppy/rushed code, so look at this as a good thing, where you will learn the correct method of performing what it is you want to perform.

that's my 2c.
 

Attachments

Ok, thanks for all the advice but I think I sorted out the problem. Look I am not a genius with VB, I am a good manipulated of code. Do not always understand what I am doing but I was able to do some amazing things already.

The solution was I changed in the declarations:

Dim dbsReport As Database
Dim rstReport As Recordset


To
Dim dbsReport As DAO.Database
Dim rstReport As DAO.Recordset


Don’t ask me why but it worked

Lance
 
The solution was I changed in the declarations:

Dim dbsReport As Database
Dim rstReport As Recordset

To
Dim dbsReport As DAO.Database
Dim rstReport As DAO.Recordset

Don’t ask me why but it worked

Lance
Because it couldn't figure out what you wanted and being explicit because there are ADO recordsets as well as DAO recordsets helps.
 
Ok, thanks for all the advice but I think I sorted out the problem. Look I am not a genius with VB, I am a good manipulated of code. Do not always understand what I am doing but I was able to do some amazing things already.

The solution was I changed in the declarations:

Dim dbsReport As Database
Dim rstReport As Recordset


To
Dim dbsReport As DAO.Database
Dim rstReport As DAO.Recordset


Don’t ask me why but it worked

Lance

glad you sorted it. would never have thought of that, myself. i think i kind of had the right idea when i said maybe access 2007 is more stringent in code, but where to look was beyond me.

thank you for posting your solution :)
 

Users who are viewing this thread

Back
Top Bottom