I have a report that is bing used as a quiz it has 4 conditional formatting rules that highlight a correct answers. I am looking for a way to disable to rules with a button so the quiz can be printed out without the answers highlighted. Thanks.
What I ended up doing was just to make a button called "Delete Answers" and add
Private SUB Command15_Click()
Answer1.FormatConditions.Delete
Answer2.FormatConditions.Delete
Answer3.FormatConditions.Delete
Answer4.FormatConditions.Delete
End Sub
This is good enough for the time being, I didnt know you could do conditional formating with vba. I'll workout how to toggle on and off later.
I have several lengthy reports with some very complex colour formatting of data from crosstab queries.
For example:
The complexity of the CF means the report can be very slow to load and can take well over a minute on older PCs
So, when selecting the report, a message box pops up giving users the option of printing a version without CF ... which loads instantly.
There is no need to have two separate reports for this. Use the message box to set the value of a boolean global variable blnCF (or use a tempvar) and use that as an OpenArgs argument when opening your report.
What I ended up doing was just to make a button called "Delete Answers" and add
Private SUB Command15_Click()
Answer1.FormatConditions.Delete
Answer2.FormatConditions.Delete
Answer3.FormatConditions.Delete
Answer4.FormatConditions.Delete
End Sub
This is good enough for the time being, I didnt know you could do conditional formating with vba. I'll workout how to toggle on and off later.
Well, I have worked my way back to this problem and I am looking to add two buttons to my reports "Answers on" and "Answers off."
I currently have four text fields that have conditional formatting applied using the access conditional format tool.
"Expression is [Correct1]=True" then it fills the box green. I repeat this four times for each answer box. Then I have a button to remove the answers for printing that uses.
Code:
Private Sub Command26_Click()
Answer1.FormatConditions.Delete
Answer2.FormatConditions.Delete
Answer3.FormatConditions.Delete
Answer4.FormatConditions.Delete
End Sub
It works fine for most instructors, but there are a few that forget to print the answer key. So I would like to convert the conditional format tool results to VBA and stick it in a button called "Answers on"