Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a form in a access db from other access db

Status
Not open for further replies.

engrmpk

Programmer
Feb 24, 2008
13
CA
i have one access db, where i have created few buttons, when i click one of the button, it opens to new db and specified form with this code:


Dim ObjAccess As Object
Set ObjAccess = CreateObject("Access.Application")
ObjAccess.Visible = True
ObjAccess.OpenCurrentDatabase "Here comes the directory and db name.mde"
ObjAccess.DoCmd.OpenForm " frmName"



This works fine but when i work with new opened form, this will suppress the warnings, for example if i use append query, it will append but won't tell me, how many rows i have appended, though if i go to that db direct without through access form click, it works fine?
what could be reason if I open the db with the above method, it dont work properly.
 
A couple guesses...
Try adding the below line of code to the end.

Code:
Set ObjAccess = Nothing

If not try adding the following above it the line I had you above.

Code:
ObjAccess.docmd.setwarnings = True


Read the help topic for OpenCurrentDatabase and see if it sheds any light on the topic.
 
I tried both separately and collectively but nothing happened, doing samething.
 
I have found the Solution:
Just use one line code:

Application.FollowHyperlink "directory and dbname.mde"

and set the opening form in the specified db as autoexec.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top