Results 1 to 5 of 5

Thread: Using a form to return information

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2003
    Location
    Chicagoland
    Posts
    92

    Using a form to return information

    My program copies files from a user's hard drive to a network drive. In one case, the user must decide into which subdirectory a file should go. I want to pop up a form that asks, "Should this file go into subdirectory A?" and give two radio buttons of yes and no and an OK button.

    I'd like the popup form to return a 1 if the yes radio button is checked and a 0 if the no radio button is checked so I could use the result in an if statement like:

    VB Code:
    1. Dim Frm2 As Form2
    2. Dim dir As String
    3.  
    4. If Frm2.show().result() Then
    5.      dir = "SubdirectoryA"
    6. Else
    7.      dir = "SubdirectoryB"
    8. End If

    I have Frm2.show().result(), but I don't know what should go there.

    Does this make any sense?

  2. #2

  3. #3
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Couldn't you use a "Save As" dialog control?

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Actually on second look wouldn't a normal Msgbox work?
    VB Code:
    1. If MsgBox("Should this file go into subdirectory A?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
    2.             dir = "SubdirectoryA"
    3.         Else
    4.             dir = "SubdirectoryB"
    5.         End If

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2003
    Location
    Chicagoland
    Posts
    92
    Thanks Edneesis. I broke out in a cold sweat when I looked at your tutorial, but the MsgBox idea was right up my alley.

    I am ashamed that I didn't think of it myself.

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