Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 25th, 2003, 09:46 AM
Cbridges Cbridges is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: PA
Posts: 1 Cbridges User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Open another Access Db

I would like to use a command button/event procedure on a Form in DB1 to Open a Form and add a record in DB2. They are 2 separate Access .mdb Databases. Once this is done I need to return to the Form in the First DB. Is this possible?

Reply With Quote
  #2  
Old November 25th, 2003, 01:31 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
Is there a reason way you aren't trying to add the record in DB2 from the db1 interface?

The other way, if possible, won't be easy (I have never tried). I usually link to the other DBs as needed and add the information that is need from One Interface.

S-

Reply With Quote
  #3  
Old November 26th, 2003, 02:51 PM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
Hi,

I enclose a code from one of my old projects. The sub below appends a record to a table being in a remote database. I didn't modify the code to make it more sample-like so I apology for the strange object names and values (I just put some notes).

Public Sub AddAKohalmi()
'variable declaration:
Dim wsp As DAO.Workspace
Dim db As DAO.Database
Dim rs As DAO.Recordset
'create the workspace object to access the other database:
Set wsp = CreateWorkspace("", "admin", "", dbUseJet)
'create a database object pointing to the remote database you wish to open and, in the same time, open it:
Set db = wsp.OpenDatabase("S:\Marketing\Database\OSGPriceList_Tables.mdb", False, False)
'open the table in the remote database
Set rs = db.OpenRecordset("tblUsers")
With rs
.AddNew
!UserID = "AKOHALMI"
!FullName = "Kohalmi, Aniko"
!UsrGroup = "Sales"
!AccMgr = True
.Update
.Close
End With
Set wsp = Nothing
Set db = Nothing
End Sub

I hope this helps you.

BRegs,

TBÁrpi

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Open another Access Db


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT