• calling a procedure in a different form (97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » calling a procedure in a different form (97)

    Author
    Topic
    #369358

    hi all

    i am trying to call the public function “search()” in a form from another form. i am using the code

    Eval [Forms]![frmkeyrequisitionssearch].search()

    which does what it is supposed to (calls the function), but then gives me the error “The expression you entered contains invalid syntax. You may have entered a comma without a preceeding value or identifier.”

    i am going to take a long shot and say my code there is incorrect, but i can’t find any relevant help on the subject. please let me know what i am doing wrong. again, the function get carried out perfectly, but then it gives me the error.

    thanks in advance

    Viewing 0 reply threads
    Author
    Replies
    • #581370

      (According to the online Help, Eval takes a string argument.)

      You can call the function in the following way – no Eval or () needed:
      Form_frmkeyrequisitionssearch.search

      • #581371

        hey, it works! wow, that was simple.. thanks a bunch

      • #581484

        You can also call it as a public method of the form instance (rather than its module) like this:

        Forms!frmkeyrequisitionssearch.Search()

    Viewing 0 reply threads
    Reply To: calling a procedure in a different form (97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: