Toggle Button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to set up a toggle button that can turn on or off a fixed "Instructions" form as another window - I've got the instructions form complete without scroll bars or size/close controls

How can I check the changed value of the Toggle Button to see if I need to open the Instruction form or close it

Thank you
Derek
 
Use the AfterUpdate event of the toggle button to test its value. This sort
of thing:

Private Sub tblOtherForm_AfterUpdate()
Dim strDoc As String
strDoc = "NameOfYourOtherForm"
If Me.tblOtherForm.Value Then
DoCmd.OpenForm strDoc
Else
DoCmd.Close acForm, strDoc
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Derek Wittman said:
I would like to set up a toggle button that can turn on or off a fixed
"Instructions" form as another window - I've got the instructions form
complete without scroll bars or size/close controls.
How can I check the changed value of the Toggle Button to see if I need to
open the Instruction form or close it?
 
Put the following code in the OnClick event of the toggle button

If Me!NameOfToggleButton = True Then
DoCmd.Close acForm, "NameOfInstructionsForm"
Else
DoCmd.OpenForm, "NameOfInstructionsForm"
End If


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


Derek Wittman said:
I would like to set up a toggle button that can turn on or off a fixed
"Instructions" form as another window - I've got the instructions form complete
without scroll bars or size/close controls.
How can I check the changed value of the Toggle Button to see if I need to
open the Instruction form or close it?
 
Thanks for the help - both of you. Is there anyway to do it according to conditions on the value in a macro? and just keep running the macro to check whenever the value changes? (onclick or after update

Thanks
Derek
 
Yes, Derek.

That's what we meant when we said:
Use the AfterUpdate event of the toggle button ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Derek Wittman said:
Thanks for the help - both of you. Is there anyway to do it according to
conditions on the value in a macro? and just keep running the macro to
check whenever the value changes? (onclick or after update)
 
I guess I missed that. I actually made it using the True and False values of the toggle button, running the macro Onclick. If the togglebutton was TRUE, I opened the Instruction Form (just an unsizable, unclosable set of instructions). If it was False, I Closed the form.

My boss signed off on the application (no database window, no menus, just some forms)

Startup --> Information For
OnClose --> Entry For
OnClick (toggle button) --> Toggle Macro (open and close Instruction form window
OnClick (cancel button) --> Cancel Macro (initializes table behind Entry Form by unbinding and copying the format over it
OnClick (submit button) --> Submit Macro (sends the updated information to me, append query adds to my master table, and select query shows new records onscreen in Update Form
OnClose --> Qui

It's not a complex application, but it beats using Outlook and coding links between an Outlook Form and the Access Table

Thank you
Dere

----- Allen Browne wrote: ----

Yes, Derek

That's what we meant when we said
Use the AfterUpdate event of the toggle button ..

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.htm
Reply to group, rather than allenbrowne at mvps dot org

Derek Wittman said:
Thanks for the help - both of you. Is there anyway to do it according t
conditions on the value in a macro? and just keep running the macro t
check whenever the value changes? (onclick or after update
 
Back
Top