By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 3,102 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Getting a toggle to open a form

P: 2
When my Main Menu opens it opens another Form MiniMain
Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "frmMiniMain"
End Sub

But I have a toggle switch on my Main Menu that I want to control whether it opens or not,this is the toggle settings, I need the script to make it work
Table: tblSetStableControlsSettings,
Field Name: MiniMain...............Turnip
Dec 18 '06 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,307
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     If UCase(DLookup("MiniMain","tblSetStableControlsSettings"))="TURNIP" Then _
  3.         DoCmd.OpenForm "frmMiniMain"
  4. End Sub
Dec 19 '06 #2

P: 2
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     If UCase(DLookup("MiniMain","tblSetStableControlsSettings"))="TURNIP" Then _
  3.         DoCmd.OpenForm "frmMiniMain"
  4. End Sub
Thanks Neo, just changed Turnip for -1 :)
Worked Great Thanks
Dec 19 '06 #3

NeoPa
Expert Mod 15k+
P: 31,307
Thanks Neo, just changed Turnip for -1 :)
Worked Great Thanks
Pleasure.
However, if it is compared to -1 then you're better of simply saying :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     If DLookup("MiniMain","tblSetStableControlsSettings") Then _
  3.         DoCmd.OpenForm "frmMiniMain"
  4. End Sub
Dec 19 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.