Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    313

    Unanswered: Make a new form from another form style

    Hi,
    In Visual Basic of the form,

    Suppose I have a form "na",
    I want to create another form using the VB, the form style and format as sama as the "na", all the fields are same, same positions.

    Dim frm As Form

    Set frm = CreateForm(, "na")
    DoCmd.Restore
    frm.RecordSource = "na"

    I tried these code, the code is created based on "na", but it still needs to add the fields, and it will automatically open the design view to design, i want to VB to copy the "na" design to the new form.

    How can I write? Does VB copy the same design and format to the new form?
    Please let me know,
    Thanks.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Do you need to do it programmatically? If not, the simple solution is to copy and paste your existing form...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Sep 2005
    Posts
    313
    VB progamming.

    Because I going to make a form, "user",

    when I input a new username, then the program will create the table, and the form.

    eg.
    table: Admin
    fields: ID, approved, date
    form: Admin (already designed)

    table : Amy
    Then, table "Amy" will be created as same as the Admin table (ID, approved, and date), and also the form is created as same as the Admin form design,(of course the recordsource is Amy).

    I am asking the VB programming language. Thanks.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if the form design is the same, then why tinkler with it, just change the underlying recordsource for the form.

    The way you are proposing sounds a nightmare - for each user you intened having a differnet form. what happens if you decide to change the design (add new features, dare I say it correct some bugs).

    Do you really want to got through an unsepcifed number of forms changing the same element. Beside which you are creating a poor design: theoretically you cold bust the limits on an access model by breaking an internal magic number of controls by having an open ended number of users.

    You probably could programtically copy the form design iterating through the forms collection. the help file has some good examples of what can be done - I don't think it covers precisely what you want but it should point you in the right direction

  5. #5
    Join Date
    Sep 2005
    Posts
    313
    Ok, I did that Thanks.
    Last edited by accessman2; 01-15-06 at 14:12.

  6. #6
    Join Date
    Sep 2005
    Posts
    313
    Ok, I did that Thanks.
    Last edited by accessman2; 01-15-06 at 14:12.

Posting Permissions

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