robboll wrote:
[Quoted Text] > Access 2003 > > I have a form with six paired checkboxes (for three events) A, B, and > C. > > Event Start End > > A --------- AS ----------- AE > B --------- BS ----------- BE > C --------- CS ----------- CE > > And a Status textbox. The Status is either "Pending" or "Waiting" > > When you open the form and all checkboxes are 0 the Status = "Pending" > > If you check AS the Status changes to "Waiting" until AE is checked. > Then it changes back to "Pending" > > The same thing applies to B and C. > > My code below seems to work if you move from A to C, but moving up it > doesn't work. > > Any time a Start is checked and and an End is unchecked, the Status > should be Waiting. > > I think theres a much easier way to do this: > > Function Stat() >
Your way just didn't change things back if something was unchecked. I changed to True and False to make things clearer (at least for me) This is untested and may need some lines swapped but the method is good.
'A --------------- If Forms!frmStatus!ASD = True then If Forms!frmStatus!AE = FalseThen Forms!frmStatus!txtSTATUS = "Waiting" Else ' Change it back if it was already checked. Forms!frmStatus!txtSTATUS = "Pending" End If Else 'Change it back if it was checked. Forms!frmStatus!txtSTATUS = "Pending" > End If >
|