Full Version: Hide or "Grey Out" a Record on a Form
UtterAccess Forums > Microsoft® Access > Access Forms
davenportjacque
I have a form set up to be Continuous Forms and would like to hide or "grey out" certain records.
I've tried...
Private Sub Check9_AfterUpdate()
Me.Writer.visible = Me.Check9
End Sub
and
Private Sub Command6_Click()
Me.Writer.Enabled = Not Me.Writer.Enabled
End Sub
But as ya'll can probably tell, it applies to *all* the records.
Ofeel as if I'm really close, but just can't seem to get it.
Help!
davenportjacque
In looking around it seems as if a filter would be what I am looking for.
oes that sound right?
HiTechCoach
I agree that you should add criteria to the sub form's record source to "filter out" the records you do not want to see.

You could reference the parent form for the criteria then requery the subform after entering the criteria.

Example:
CODE
Private Sub Check9_AfterUpdate()
nbsp;  Me.[YourSubFormName].Requery
End Sub



Hope this helps...
alton
I am also looking for similar advice.
The records I don't want users to see are filtered out (i.e. they are records that are "flagged" as being dealt with so are no longer displayed).
I want some users, however (e.g. supervisors) to be able to view these records but not be able to edit them, if they are flagged as true.
The filtered views are controlled by command buttons; one is "show all" and one is "show outstanding". These buttons simply filter the data on the current form.
Is there any way whatsoever to implement the above? i.e. have a form with continuous records, some which are enabled, some which aren't?
Yours,
Alton.
tpd15
How about using Conditional Formatting? This is available thru #Format, #Conditional Formatting. You can enable / disable the controls & change their colour based on a field within the row, or something else. It will do this row-by-row in a continuous form, not the all-for-one thing you've found so far.
If you truely didn't even want to see those rows, just hide them with a filter.
alton
Thanks for your help. Omitted to consider conditional formatting in this instance.
ours,
Alton.
tpd15
Alton,
I did you get your buttons to work to show / hide the various records? I couldn't tell from your post if that is something you already have, or something you want to do.
alton
Dear tpd15,
Yes my command buttons work (i.e. one filters the records to show only outstanding and the other removes the filter so ALL records are displayed).
Thanks for your concern.
I will try the conditional formatting when I return to work next week.
Yours,
Alton.
tpd15
Alton,
Glad it's working for you. Good luck with the conditional formatting.
alton
Yep, the conditional formatting worked a treat.
formatted each control so that where the "sent" flag was checked, (i.e. [SentToAccounts]=True).
This worked with the text boxes and combo boxes on the form. Is there anyway to use this on a check box however?
Yours,
Alton.
tpd15
Alton,
redging my memory here... with a check box you may need to set it to "yes" or "-1" (the true value is -1, not 1, false is 0). give that a shot.
alton
When I select the check box in design view, and go to the formatting menu, the option for Conditional Formatting is disabled.
Thank you for your help though.
Yours,
Alton.
tpd15
I'd forgotten that CF isn't availble on all types of control. Labels & buttons also can't be CF'd. Hmm, I don't know what you can do about that. Some kind of creative workaround?
h, is this continuous form open for editing, or is it read-only? If read-only, you could instead make a text control or something that alternates its display to mimic if it's On or Off.
alton
It's opened for editing - apart from those that are disabled by conditional formatting obviously!!
Thanks for your help nonetheless; I'll have to see what I can do!
Yours,
Alton.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.