Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Thanked 0 Times in 0 Posts

    Import any available forms (Access 2000)

    Is there any way to give a command to import all the forms from a database?

    I couldnt doi it. I tried to import all the forms from a database into my database where i have only one form. This form is called Form1, and on its control on the OnClick event i have the following line:
    ImportAllForms( "C:BEtemp.mdb")

    and the function is :

    Private Function ImportAllForms(strDbName As String)
    Dim appAccess As Access.Application
    Dim frm As AccessObject
    Set appAccess = New Access.Application
    appAccess.OpenCurrentDatabase strDbName, False
    For Each frm In appAccess.CurrentProject.AllForms
    DoCmd.TransferDatabase acImport, "Microsoft Access", strDbName, acForm, frm.Name, frm.Name
    Next frm
    Set appAccess = Nothing
    End Function

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Import any available forms (Access 2000)

    Can you specify what goes wrong, and where? I just copied your code into a test database, and it worked OK without any modification - it imported all forms from the database I specified. Are you sure that temp.mdb contains forms?

Posting Permissions

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