|
-
Jun 12th, 2003, 12:43 PM
#1
Thread Starter
Addicted Member
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?
-
Jun 12th, 2003, 08:40 PM
#2
Hyperactive Member
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.
-
Jun 13th, 2003, 04:22 PM
#3
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|