UserForms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lyle Fairfield

    #1

    UserForms

    Do you know about UserForms in Access?

    UserForms seems to me to be just like VB Forms, or Excel UserForms.
    They are not Access objects and have little or nothing to do with
    Access forms. In the Project Explorer that appear in a Forms folder,
    far removed from Microsoft Access Class Objects. They have a very full
    set of editable properties, code modules, controls etc.

    They can be created in Access 2003.

    That's about all I know. I've created them, put controls on them (not
    data controls of course, but, for example, command buttons).

    Now I have only two problems.

    The first is that creating them totally and AFAICT irrevocably corrupts
    the VBA project of the Access database and by extension anything at all
    of the db that has to to do with VBA (which is why I haven't told you
    how I created them; if you're going to cook your DB then you should
    come up with the recipe yourself). One more time; THEY HAVE ALWAYS
    TRASHED MY DB, SO I STRONGLY SUGGEST YOU USE ONLY A THROW_AWAY_COPY IF
    YOU EXPERIMENT. Some people will think of this as a negative.

    and

    I can't open them.

    I don't find references to these in Google or in MSDN but myabe I'm not
    recognizing these when I see them.

    Would they be good for anything? I'm not sure.

    Why did I fool with these. A few weeks ago someone in here asked about
    the VBA Load Sub. It seemed to be related to a VBA form and not an
    Access form. So I wanted to see if I could create a VBA form.And yes,
    one can.

    I thought one might need the VBA Extensibility reference to do this,
    but it nows seems (75%) that I do not.

    So, any experience, opinion, reference about these?

  • Lyle Fairfield

    #2
    Re: UserForms

    Well, the over-whelming interest is over-whelming.

    I now have an example that works and does not corrupt the world. (But
    can I ever create a second such example)?

    It has a command button. The code behind the command button is:

    Private Sub CommandButton1_ Click()
    MsgBox "blah"
    End Sub

    It works.

    So now I have a user form that does what I can do with an Access form.
    Yay!

    Now what?

    Now I need someone to tell me something he/she has always wanted to do
    with an Access form that he'she can't, but that he/she is pretty sure
    can be done with a VBA form.
    Maybe set the back color of the command button? Can I do that on the
    UserForm? Yes!
    Can I set the back color of a command button on an Access form?
    hmmmmmmmm . I've never tried this so let's see. Well, it's greyed out
    so maybe the answer is no?

    Ouch. It seems that when the UserForm is created a reference to
    Microsoft Forms 2.0 is created automatically.

    Back to the hockey game. The Prunes are winning.

    Comment

    • RoyVidar

      #3
      Re: UserForms

      Lyle Fairfield wrote in message
      <1135303332.357 643.241230@g43g 2000cwa.googleg roups.com> :[color=blue]
      > Well, the over-whelming interest is over-whelming.
      >
      > I now have an example that works and does not corrupt the world. (But
      > can I ever create a second such example)?
      >
      > It has a command button. The code behind the command button is:
      >
      > Private Sub CommandButton1_ Click()
      > MsgBox "blah"
      > End Sub
      >
      > It works.
      >
      > So now I have a user form that does what I can do with an Access form.
      > Yay!
      >
      > Now what?
      >
      > Now I need someone to tell me something he/she has always wanted to do
      > with an Access form that he'she can't, but that he/she is pretty sure
      > can be done with a VBA form.
      > Maybe set the back color of the command button? Can I do that on the
      > UserForm? Yes!
      > Can I set the back color of a command button on an Access form?
      > hmmmmmmmm . I've never tried this so let's see. Well, it's greyed out
      > so maybe the answer is no?
      >
      > Ouch. It seems that when the UserForm is created a reference to
      > Microsoft Forms 2.0 is created automatically.
      >
      > Back to the hockey game. The Prunes are winning.[/color]

      One question, if I may - how did you create the userform
      initially?

      I'm not able to do that through "ordinary means" (insert menu).
      In the versions I've tested this, 2000-2003, I had to export a
      userform from Word/Excel, then import it to Access, either
      that, or do some commandbar tweak that I suspect are
      available more because of the shared IDE than planned
      availability in the Access VBE IDE.

      A while ago, out of pure curiosity, I just tested some
      imported userforms in Access, and confirmed they behaved just
      as they did in Word/Excel.

      As far as I can see or judge, the userforms are not native to
      Access, and I don't know enough about how usage of them could
      influence the rest of the project (re your corruption
      experience, which I have not experienced), so I don't think
      I'm going to start using them. Unless off course, someone can
      point out some major benefits of them vs Access forms.

      Have you had any success removing the MSForms2 reference
      after removing the UserForm?

      Here's the first Google reference I got with the term "Access
      UserForm" (just lucky I guess, cause it's a bit hard finding
      more;-)


      --
      Roy-Vidar

      Comment

      • Lyle Fairfield

        #4
        Re: UserForms

        I've just skimmed the article.
        I created a userform in the same way he/she describes.
        That is I customized a menu (toolbar works too) and from the Insert
        group, dragged the Insert UserForm Button to a menu location. Clicking
        that button creates a UserForm.

        Comment

        Working...