Form does not display controls when opened through AutoExec macro

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dstorms
    New Member
    • Oct 2007
    • 25

    Form does not display controls when opened through AutoExec macro

    Something very strange going on here! Don't know where dstorms original post went! The post, in essence, stated that his form, containing a checkbox and a textbox, opened fine if opened independently, but opened without any controls showing if opened thru the Autoexec macro. The form was set up to open only Where ...checkbox = 1, but would open as stated above, with no controls showing, whether the box was checked or unchecked.
    **************
    A checkbox can only have a value of 0 (zero) or -1! A value of 1, without the minus sign, is not valid!

    Correct this and try it again. By default, forms with AllowAdditions set to No and without records in the recordsource open as you've indicated, without any controls being visible. The option you chose in the macro builder, to open the form, may be one where AllowAdditions is set to No.

    Welcome to TheScripts!

    Linq ;0)>
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    I've reported the above noted strange behavior to management!

    Linq ;0)>

    Comment

    • dstorms
      New Member
      • Oct 2007
      • 25

      #3
      Linq,

      Yes, that is weird. Thank you for responding.

      So it's -1, not 1, that makes the check box work. I tried and, voila! the message displayed exactly as I intended.

      But when the box is unchecked, I get a blank form. I don't want it to appear at all. Maybe a CloseForm WHERE checkbox=0?

      Or could I create a VBA module that offers more control, and run it from the AutoExec macro? Some thing like this:

      If checkbox=-1 then go to OpenFormSub
      End Sub

      Sub OpenFormSub
      DoCmd.OpenForm. ..

      (I know how to code it, just giving an example of the top of my head.)

      Doug

      Comment

      Working...