g-richardson
Registered User.
- Local time
- Today, 07:56
- Joined
- Mar 4, 2005
- Messages
- 42
So I'm trying to get the look, caption and the result of a click on a command button based on the refreshed data contained in a subform. This needs to be dynamic in that as a new date on the form's calendar is selected, the results listed in the subform will change based on that date and I need the command button to refresh based on the new subform results.
I've been able to get my caption to change (attempting to get one thing done and then build on it), but I could only get it to change when the command button lost focus, but then it wouldn't change back.
So basic example.
cmd0 - caption = "Available", so if I clidk on the command button, a form will open for someone to claim the space. When the form closes, the subform on the mainform containing the cmd0 button will refresh to show the space is booked. Would like cmd0 - caption = "Booked".
This is the sample Code I've tried...My first attempt at my own code and not just modify what I see here so please be gentle
...
Sample Code:
If Forms!frm_CubeLayout!sfrm_Booked.Form!Space = "Space 94" And Forms!frm_CubeLayout!sfrm_Booked.Form!BookDate = Forms!frm_CubeLayout.Form!BookDate Then
Me.cmd0.Caption = "Booked"
Else
Me.cmd0.Caption = "Available"
End If
End Sample Code:
My two questions; a) can this code do what I'm asking? b) where can I place the correct code to get it to read the current state of the subform?
Thanks for ANY help.
I've been able to get my caption to change (attempting to get one thing done and then build on it), but I could only get it to change when the command button lost focus, but then it wouldn't change back.
So basic example.
cmd0 - caption = "Available", so if I clidk on the command button, a form will open for someone to claim the space. When the form closes, the subform on the mainform containing the cmd0 button will refresh to show the space is booked. Would like cmd0 - caption = "Booked".
This is the sample Code I've tried...My first attempt at my own code and not just modify what I see here so please be gentle
Sample Code:
If Forms!frm_CubeLayout!sfrm_Booked.Form!Space = "Space 94" And Forms!frm_CubeLayout!sfrm_Booked.Form!BookDate = Forms!frm_CubeLayout.Form!BookDate Then
Me.cmd0.Caption = "Booked"
Else
Me.cmd0.Caption = "Available"
End If
End Sample Code:
My two questions; a) can this code do what I'm asking? b) where can I place the correct code to get it to read the current state of the subform?
Thanks for ANY help.