|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||
|
|||
|
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- |
|
#3
|
||||
|
||||
|
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 |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Open another Access Db |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|