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

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Change Value on Another Form (Windows XP SP2/VBA)

    Author
    Topic
    #415271

    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

    Viewing 0 reply threads
    Author
    Replies
    • #925657

      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

    Viewing 0 reply threads
    Reply To: Change Value on Another Form (Windows XP SP2/VBA)

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

    Your information: