Results 1 to 13 of 13

Thread: [RESOLVED] Another VB Mystery??

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2005
    Location
    Florida
    Posts
    107

    Resolved [RESOLVED] Another VB Mystery??

    Hi again. I have one form (form1) opening another form (form2) as a dialog box. The user may enter some data into form2, then will press either cmdOK or cmdCancel to finish.

    I want form1 to be able to know which button the user pressed in form2. I tried it like this;

    VB Code:
    1. {form1}
    2.     load form2
    3.     form2.show
    4.  
    5. {form2}
    6. Private Sub cmdCancel_Click()
    7.     Me.Visible = False
    8. End Sub
    9.  
    10. {form1 again}
    11.     if form2.cmdCancel.value then
    12.          (disregard the operation because they pressed the cancel cmd button)
    13.     endif

    In the form2 cmd_click sub, the cmdCancel property is TRUE after they press Cancel. But as I step thru the program, I notice that when it returns to form1, the cmdCancel value is set to FALSE.

    Any ideas how form1 can read the values of the form2 command buttons?

    Thanks again - Tom
    Last edited by Tom951; Sep 22nd, 2005 at 01:00 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width