Results 1 to 3 of 3

Thread: Can I access MS Access forms?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164

    Can I access MS Access forms?

    I have an extension for another program that I am creating. Instead of duplicating the forms in VB that already exist within the Access database, I was wondering if I could somehow just grab those forms and use them within my VB app? Or even open MS Access to a specific form and a specific record?
    -Shurijo

  2. #2
    Hyperactive Member
    Join Date
    May 2002
    Location
    Wisconsin, USA
    Posts
    279
    I don't know of anyway to do that. I don't think you can.

    You might be able to recreate the forms and copy the code for the access forms. You would then have to modify the code so that the syntax and stuff works, but that is the easiest way that I can think of.

  3. #3
    I believe it's something like this, but it's been awhile...


    'Create a new Access Instance
    Dim apDB As New Access.Application

    'Open an Access Form
    Private Sub Button_Click()
    apDB.DoCmd.OpenForm "frmMain", acNormal, , , , acDialog
    End Sub



    Be sure to open and close the Access Database...


    'Open a Database
    Private Sub Form_Load()
    apDB.OpenCurrentDatabase "C:\MyDB.mdb", True
    End Sub

    'Close the database and Instance
    Private Sub Form_Unload(Cancel As Integer)

    apDB.CloseCurrentDatabase
    apDB.DoCmd.Quit acQuitSaveNone
    End Sub



    not sure if all that still works, but it may lead you in the right direction...
    You'd probably be better off re-creating the forms in VB though, sicne you'll have to open and close the Access Window, but it depends on your application, and if you care.
    Last edited by Arkhos; Jun 13th, 2003 at 04:29 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