Results 1 to 5 of 5

Thread: Set value

  1. #1
    Join Date
    Jun 2002
    Posts
    22

    Unanswered: Set value

    I have a beginner's question
    How can I set a value to a variable that is declared:
    dim frm as Form

    10x

  2. #2
    Join Date
    Jul 2002
    Posts
    67
    Dim frm as Form
    Set frm = Forms!frmMyForm


    Don't do today, what can be done tomorrow.

  3. #3
    Join Date
    Jun 2002
    Posts
    22
    When I try to send the variable frm to a function that expect
    a form variable - run time error "type mismatch"
    and looking in the Immediate Window at frm gives the same error.

  4. #4
    Join Date
    Aug 2002
    Location
    Singapore
    Posts
    91
    Are you sure that the function requires "Form", and the variable that you pass is Form? You should dim it as form.

    What function is it? Some function, such as DoCmd.OpenForm... will require form name (string...), not the form itself. If you declare the function yourself, put (... As Form) on the argument list.

  5. #5
    Join Date
    Jun 2002
    Posts
    22
    The Sub declared: Public Sub MySub(frm As Form)
    and the variable declared:

    dim frm as form
    set frm = forms!MyForm
    MySub(frm)

Posting Permissions

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