form object

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

    #1

    form object

    Hello

    I am really confused on this.
    I have a button that calls a module.

    Sub verifyUser(frmE ntry As Form)
    This module does a few things then it opens a form.

    I am passing a variable as form to the module
    call verifyUser("frm FollowUp")

    If add quotes it says type mismatch if I remove the quotes it says
    "Byref argument type mismatch"

    I don't know what I am doing wrong.
    Please help.

    Thanks.

    Simone
  • Wayne Morgan

    #2
    Re: form object

    You are defining frmEntry as a Form, but you are passing a form's name (a
    string value), not a form.

    --
    Wayne Morgan
    Microsoft Access MVP


    "Simone" <oimone@hotmail .com> wrote in message
    news:fca7e30a.0 311250643.48ebb 77f@posting.goo gle.com...[color=blue]
    > Hello
    >
    > I am really confused on this.
    > I have a button that calls a module.
    >
    > Sub verifyUser(frmE ntry As Form)
    > This module does a few things then it opens a form.
    >
    > I am passing a variable as form to the module
    > call verifyUser("frm FollowUp")
    >
    > If add quotes it says type mismatch if I remove the quotes it says
    > "Byref argument type mismatch"
    >
    > I don't know what I am doing wrong.
    > Please help.
    >
    > Thanks.
    >
    > Simone[/color]


    Comment

    • Simone

      #3
      Re: form object

      Thanks before you posted I changed to string and it worked.
      My issue now is I need it to be a form object because once runs
      through the code I want to pass a value to a text box for that form
      object. Using text I can't do frmEntry.contro lname
      I tried passing but I get the same error before.

      Any ideas?
      Thanks.





      "Wayne Morgan" <comprev_gothro ughthenewsgroup @hotmail.com> wrote in message news:<mSKwb.300 71$do1.17980@ne wssvr32.news.pr odigy.com>...[color=blue]
      > You are defining frmEntry as a Form, but you are passing a form's name (a
      > string value), not a form.
      >
      > --
      > Wayne Morgan
      > Microsoft Access MVP
      >
      >
      > "Simone" <oimone@hotmail .com> wrote in message
      > news:fca7e30a.0 311250643.48ebb 77f@posting.goo gle.com...[color=green]
      > > Hello
      > >
      > > I am really confused on this.
      > > I have a button that calls a module.
      > >
      > > Sub verifyUser(frmE ntry As Form)
      > > This module does a few things then it opens a form.
      > >
      > > I am passing a variable as form to the module
      > > call verifyUser("frm FollowUp")
      > >
      > > If add quotes it says type mismatch if I remove the quotes it says
      > > "Byref argument type mismatch"
      > >
      > > I don't know what I am doing wrong.
      > > Please help.
      > >
      > > Thanks.
      > >
      > > Simone[/color][/color]

      Comment

      • Wayne Morgan

        #4
        Re: form object

        Forms!frmEntry! ControlName

        --
        Wayne Morgan
        MS Access MVP


        "Simone" <oimone@hotmail .com> wrote in message
        news:fca7e30a.0 311251111.1e8f6 c23@posting.goo gle.com...[color=blue]
        > Thanks before you posted I changed to string and it worked.
        > My issue now is I need it to be a form object because once runs
        > through the code I want to pass a value to a text box for that form
        > object. Using text I can't do frmEntry.contro lname
        > I tried passing but I get the same error before.
        >
        > Any ideas?
        > Thanks.
        >
        >
        >
        >
        >
        > "Wayne Morgan" <comprev_gothro ughthenewsgroup @hotmail.com> wrote in[/color]
        message news:<mSKwb.300 71$do1.17980@ne wssvr32.news.pr odigy.com>...[color=blue][color=green]
        > > You are defining frmEntry as a Form, but you are passing a form's name[/color][/color]
        (a[color=blue][color=green]
        > > string value), not a form.
        > >
        > > --
        > > Wayne Morgan
        > > Microsoft Access MVP
        > >
        > >
        > > "Simone" <oimone@hotmail .com> wrote in message
        > > news:fca7e30a.0 311250643.48ebb 77f@posting.goo gle.com...[color=darkred]
        > > > Hello
        > > >
        > > > I am really confused on this.
        > > > I have a button that calls a module.
        > > >
        > > > Sub verifyUser(frmE ntry As Form)
        > > > This module does a few things then it opens a form.
        > > >
        > > > I am passing a variable as form to the module
        > > > call verifyUser("frm FollowUp")
        > > >
        > > > If add quotes it says type mismatch if I remove the quotes it says
        > > > "Byref argument type mismatch"
        > > >
        > > > I don't know what I am doing wrong.
        > > > Please help.
        > > >
        > > > Thanks.
        > > >
        > > > Simone[/color][/color][/color]


        Comment

        • Wayne Morgan

          #5
          Re: form object

          ps. The period will work also.

          Forms!frmEntry. ControlName

          --
          Wayne Morgan
          MS Access MVP


          "Simone" <oimone@hotmail .com> wrote in message
          news:fca7e30a.0 311251111.1e8f6 c23@posting.goo gle.com...[color=blue]
          > Thanks before you posted I changed to string and it worked.
          > My issue now is I need it to be a form object because once runs
          > through the code I want to pass a value to a text box for that form
          > object. Using text I can't do frmEntry.contro lname
          > I tried passing but I get the same error before.
          >
          > Any ideas?
          > Thanks.
          >
          >
          >
          >
          >
          > "Wayne Morgan" <comprev_gothro ughthenewsgroup @hotmail.com> wrote in[/color]
          message news:<mSKwb.300 71$do1.17980@ne wssvr32.news.pr odigy.com>...[color=blue][color=green]
          > > You are defining frmEntry as a Form, but you are passing a form's name[/color][/color]
          (a[color=blue][color=green]
          > > string value), not a form.
          > >
          > > --
          > > Wayne Morgan
          > > Microsoft Access MVP
          > >
          > >
          > > "Simone" <oimone@hotmail .com> wrote in message
          > > news:fca7e30a.0 311250643.48ebb 77f@posting.goo gle.com...[color=darkred]
          > > > Hello
          > > >
          > > > I am really confused on this.
          > > > I have a button that calls a module.
          > > >
          > > > Sub verifyUser(frmE ntry As Form)
          > > > This module does a few things then it opens a form.
          > > >
          > > > I am passing a variable as form to the module
          > > > call verifyUser("frm FollowUp")
          > > >
          > > > If add quotes it says type mismatch if I remove the quotes it says
          > > > "Byref argument type mismatch"
          > > >
          > > > I don't know what I am doing wrong.
          > > > Please help.
          > > >
          > > > Thanks.
          > > >
          > > > Simone[/color][/color][/color]


          Comment

          • smitty mittlebaum

            #6
            Re: form object

            Simone wrote:[color=blue]
            > Hello
            >
            > I am really confused on this.
            > I have a button that calls a module.
            >
            > Sub verifyUser(frmE ntry As Form)
            > This module does a few things then it opens a form.
            >
            > I am passing a variable as form to the module
            > call verifyUser("frm FollowUp")
            >
            > If add quotes it says type mismatch if I remove the quotes it says
            > "Byref argument type mismatch"
            >
            > I don't know what I am doing wrong.
            > Please help.
            >
            > Thanks.
            >
            > Simone[/color]
            I may be wrong, but I think that you need to do this BEFORE you do the call:
            DIM frmVar as form
            set frmVar = frmFollowUp
            call verifyUser(frmV ar)

            (I'm not 100% certain about the syntax for the SET command, you may need
            to look into that)

            Hope this helps a little - or a lot :)

            Comment

            Working...