Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    calling a procedure in a different form (97)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: calling a procedure in a different form (97)

    (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

  3. #3
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: calling a procedure in a different form (97)

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

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: calling a procedure in a different form (97)

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

    Forms!frmkeyrequisitionssearch.Search()
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •