I have a form which lists several records at a time, in a tabular format. On this form, there's a checkbox called postponed.
When this box is clicked, I want to disable certain checkboxes, but for that record only. Currently, my code disables the checkbox for all records.
My code is:
Private Sub Postponed_AfterUpdate()
'-1 in the Postponed checkbox means the flag is set
'0 means it's unset
If Me!postponed = -1 Then
' if the match is postponed, prevent the changing of the umpires
Me!Umpire1Choice.Enabled = False
' if the match is un-postponed, enable the changing of the umpires
Me!Umpire1Choice.Enabled = True
I've checked the Help and used Google, but to no avail. Any & all suggestions welcome.
You'll need to put in some code in the Form_Current event procedure that does exactly what your code is doing.... preferably you should call a common subprocedure from both so you don't have duplicated code
Unfortunately it doesn't solve my issue - what happens is that on clicking the checkbox the control is still disabled on every record. Moving to another record does enable the control, but on every record, including the one where the checkbox is ticked!
Am I approaching this the right way, or is there another tack I could take?
So it should be at a point that (despite the visual issue of showing disabled/enabled controls on all records) if the user selects the record first, the controls are set correctly for that record -- the current record.
Now I'm changing the value of the field in the underlying table to be one that delivers a "Match Postponed" narrative in the control. It's not pretty, and there's still some bugs to sort out (having to requery, then moving the display to the correct record) but it'll do the job.
As for coding an unbound report, I'm doing that at the moment for another section of the database. I have it working nicely placing labels with the correct data, but I cannot for the life of me figure out a way of selecting & deleting the labels currently on the report before writing new ones. Any suggestions?