Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-16-2007, 05:41 AM
Junior Member
 
Join Date: Oct 2007
Posts: 5
iTrader: (0)
DLong is on a distinguished road
Default Opening A Form In Another Database

Hi,
How do I use a command button to open a form that's in another database?
Thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-16-2007, 10:38 PM
Member
 
Join Date: Oct 2007
Posts: 41
iTrader: (0)
TonyES is on a distinguished road
Default

Hi,
You can define the other database as a reference in the first database (Alt-F11 in the first database, go to Tools | References..., click the Browse button, change the "Files of type" dropdown to "Microsoft Office Access Databases", and find the other database). Once you set the other database as a reference, in the first database you have to call a public subroutine that is in the other database (no special syntax - it will look there as well as your current database once the reference is set). That public subroutine will open the form that you want in the other database.

Using Automation, you could do this:

Dim app As New Access.Application
app.OpenCurrentDatabase "OtherDatabase.mdb"
app.DoCmd.OpenForm "frmSomething"
app.Visible = True
Set app = Nothing

Cheers!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-24-2007, 01:24 AM
Junior Member
 
Join Date: Oct 2007
Posts: 5
iTrader: (0)
DLong is on a distinguished road
Default

Thanks a lot, I will check it and will let you know.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 10:54 PM.