link VB application to Access

lamha

Registered User.
Local time
Today, 22:16
Joined
Jun 21, 2000
Messages
76
I did a Search book program in Visual Basic, but I made a form to add and modify the Book table in Access. Then I made an interface in Access which has a command button say Search. I want it to link to my VB search program at run time. Then, after I have done searching, I want to be able to go back to the Access interface. Does anyone know how to do this? Any help would be appreciated.
 
Might me easier if you did everything from either VB or Access. Depending on your code you could either convert your VB code to VBA or create a form in VB linked to your database.

However, I'm not sure about Access but in VB it is possible to open the database file and then your database can automatically load up your interface form. Seems a bit time consuming to convert to between the two.

Really depends on your search facility, if its just a series of sql statements use docmd.runsql in vba
 
If I understand correctly you have a VB app (Standard EXE) that does your searching and an Access app that you do your adding/editing. I'm unsure why you would want to have these linked as it would make sense to keep these two seperate (especially if you are allowing several different people to search but not add/edit). But the best way to link these two applications is to make the Search Application an ActiveX Exe.

By doing this you can launch the Search form from Access. Also if you set up events in the Seach app you can return information to the Access Application. You will want to read up on how to create ActiveX Exe's and how to call them.

Hope this helps
 
Where can I find this information to read?
 
You have to declare a variable of type access application
for example
dim accapp as new access.application
then
issue the following commands
accapp.OpenCurrentDatabase "yourdatabase.mdb", False
accobj.DoCmd.OpenForm "your form in access", acNormal
 

Users who are viewing this thread

Back
Top Bottom