KanedNUnable
Technical User
Hi all,
I have a master single form containing a current 'user' record, and a linked subform (continuous form) displaying all bookings for that user.
In the subform, next to each record is a command button. For each record, I want the command button's caption to either display 'delete' if the field 'deleted' has a value of 0 or 'cancel' if the field 'deleted' has a value of 1.
So far I have got this code:
[blue]
Private Sub Form_Current()
If Me.Deleted = 1 Then Me.btnDelete.Caption = "Restore" Else Me.btnDelete.Caption = "Delete"
End Sub
[/blue]
Which almost works!
The problem here is the subform might display twenty records, and the button caption only changes when you click a record - and in this case it changes the button caption next to every record to either read 'Restore' or 'Delete'.
I'm trying to make it so that as soon as the subform has been requeried, the buttons next to each record change automatically - so some in the list will say 'Restore' and some will say 'Delete'.
Is this possible?
Thanks
KanedNUnable
I have a master single form containing a current 'user' record, and a linked subform (continuous form) displaying all bookings for that user.
In the subform, next to each record is a command button. For each record, I want the command button's caption to either display 'delete' if the field 'deleted' has a value of 0 or 'cancel' if the field 'deleted' has a value of 1.
So far I have got this code:
[blue]
Private Sub Form_Current()
If Me.Deleted = 1 Then Me.btnDelete.Caption = "Restore" Else Me.btnDelete.Caption = "Delete"
End Sub
[/blue]
Which almost works!
The problem here is the subform might display twenty records, and the button caption only changes when you click a record - and in this case it changes the button caption next to every record to either read 'Restore' or 'Delete'.
I'm trying to make it so that as soon as the subform has been requeried, the buttons next to each record change automatically - so some in the list will say 'Restore' and some will say 'Delete'.
Is this possible?
Thanks
KanedNUnable