How do you make a report open as NOT read-only

hillz2k

Registered User.
Local time
Today, 21:38
Joined
Jul 18, 2008
Messages
22
Hi there,

i have a database with a report that runs and if function onopen......but everytime I try and open the report I get an error message stating that the function cant run due to the report being read-only.

Is there a way to open the report in a non read-only mode using vb or macro??

Any help would be much appreciated.

Thanx
 
What exactly is the code you are trying to run when the form opens? Unless I'm missing something it's kind of an intrinsic characteristic of a report to be read only -?
 
basically I have a global variable that is set to 1 or 2 depending on a button press. When i get the report to open if the variable is set to 1 then the report opens normally.....if its a 2 then i want report to open with one of the columns set visible = false and all the other columsn shift along to fill the gap to still have a nice looking table.

i know i could probably set up another report but i was hoping to not have to as i want to keep the number of reports down.

hope thats explained it or would you prefer to actually see the code ive used??
 
a. I don't think making the control 'not visible' is going to result in the other controls moving over on their own.

b. Are you simply wanting to execute different pcs of code when the report opens depending on which of two different buttons open it?
 
i have the code working to move the text boxes depending on which button is pressed thats all working fine. The main problem is that there isnt a .visible=false feature avaliable in the vb code in a report, what i have noticed is that there is a properties function where you can alter the properties of a text box (change text colour, border colour that sort of thing)....but it wont let me use the properties function whilst it is in read-only. Ive even tried something as basic as change the text colour depending on which button in the form but i get the same message ofnot able to alter the properties whilst in read-only mode
 
Where do you have the code?

Any code that affect the formatting ought to be in OnFormat event, IIRC; otherwise it's nonmodifiable afterward.
 
i have two bits of code.....the bit where im experiencing the problem is set to run onopen of the report. so you think if i set it to run on format it should work......cool....ill give that a try when i get back home and will post up again to keep you informed. Thanx for all your help, this has been bugging me all day
 
Right.

It seems counterintuitive, but Format event actually fires *before* Open event, and once report is opened, it's not available for any modifications, hence you getting the error that it is read-only.

BTW, if you enter 'events' in Access help, it should have a list of the sequence of events firing for both form and report to give you a good overview of which event comes first, and thus is appropriate for X use.
 
Are you trying to run the code in an .mde? You may not be able to because you cannot modify form, reports, or code in an .mde.
 
ok, ive tried all the things mentioned and no luck with any of them then :mad:.....but what I did try was to see if I could get the code to work on a form to make sure the code is vaid and i get the smae message. Therefore I ave come to the conclusion that there may be a problem with the code being used......does anyone know how to use the .properties function

ie. me.keyword.properties(visible) = false
 
fixed it......

me.keyword.properties("visible") = false

forgot the good old speach marks
 
fixed it......

me.keyword.properties("visible") = false

forgot the good old speach marks

Never heard them called 'speach marks' before:cool: If double quotes are 'speach' marks, are single quotes statement marks?:rolleyes:
 
Never heard them called 'speach marks' before:cool: If double quotes are 'speach' marks, are single quotes statement marks?:rolleyes:


they (") are called speach marks when you refer to them in english and (') are just called quotation marks........probably could have refered to them as double quote marks, but not really a a programmer so i just know them as speach marks from english?!?!
 
We call - " - quotation marks because they are used to enclose quoted words in written English.

We call - ' - apostrophes or sometimes single quotes. In written English they are used in contractions and posessive noun forms or to enclose a quote within a quote.
 

Users who are viewing this thread

Back
Top Bottom