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

    Change Value on Another Form (Windows XP SP2/VBA)

    Hello
    I am writing a VBA application (for use in AutoCAD - not sure how much that matters), but i am trying to set the value of a control on one form with a command button on another form... It seemed to me that something like Forms!frmOtherForm.OtherFormControl.value = ThisFormControl.value was the way to do this

    When I step throught the program, it gives me the message "Object Required".... Am i missing something here? Thanks in advance for your help

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

    Re: Change Value on Another Form (Windows XP SP2/VBA)

    The Forms!frmOtherForm syntax is valid for Access, not for VBA userforms. There is no Forms collection for userforms, but a UserForms collection. However, you can refer to a userform directly, using its name:

    frmOtherForm.OtherFormControl.Value = Me.ThisFormControl.Value

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

    Re: Change Value on Another Form (Windows XP SP2/VBA)

    Hans, You are just the greatest!!

    worked like a charm!

Posting Permissions

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