Results 1 to 3 of 3

Thread: reusing a form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Mexico
    Posts
    24

    Question

    I’m trying to save space so I’m wanting to use the same from to do two different things
    When I go to File Copy a database it opens form2 which displays all the databases.
    Rather than write another form when I press Command one I want it to display the same
    Form2 remember what it picked the first time and let me pick again.
    my Procedure
    File
    Select a database to copy (form2 PC has to remember my selection here)
    OK (Command1 on form2)
    Copy a database to ( want to use form2 again rather than use a form3)
    Any one know how to do this.

  2. #2
    Guest
    You can just load a new instance every time then add/change your controls as desired.
    Code:
    Dim frm As New Form2
    frm.Show

  3. #3
    Junior Member
    Join Date
    Sep 2000
    Posts
    20
    >>When I go to File Copy a database it opens form2 which >>displays all the databases.

    You could use a file open commondialog box with *.mdb for this, saving the need for form2
    and then use a file save commondialog box to copy the file.

    right click components and select Ms Common dialog control
    press F1 for the help and examples

    or

    have a public variable in the declarations section of form1
    like so....
    Public strDataBase As String

    on your ok button of form2 type.....

    form1.strDatabase = text1 '(or whatever the control on form2 is)

    then before you show form2 again you can pass back the variable like so.... (say this is form1's command2_click)
    load form2
    form2.text1 = strDatabase (
    form2.visible=true
    form2.cmdCopy.setfocus


    if you want to show form2 as a modal dialog
    then you will have to use the form2 load sub procedure
    to copy the variable like this..
    text1 = form1.strDatabase

    john


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