I have a form with modules that save new user subscription profile data. Additionally, with a double-click action on a SAVE command button, the user wants the same profile information registered in a parallel database. (Parallel meaning the app services multiple DBs)
What I've never had the occasion to do is set the name of the parallel DB in code as you see in my feeble attempt below, so a little guidance here would be most helpful. In the code below, see the statement where I want to open a DAO.Recordset in another DB. The statement is wrong, but a search on methods didn't reveal how to do that?
Code:Private Sub cmdSAVE_DblClick(Cancel As Integer) If strSDMA = "Menus" Then bolSaveAct = True 'Tell the SAVE code we need to also save the new subscriber in Activities. End Sub Private Sub cmdSAVE_Click() '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* ' Okay, everything needed to enter a new record has been satisfied. If the user action was a double-click on ' the SAVE command button, the intent is that the same individual be subscribed in our parallel DB for Activities. '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* Dim rsSav As DAO.Recordset Dim dbs As DAO.Database Dim rsActSub As DAO.Recordset If bolNewSubscriber Then Set rsSav = DBEngine(0)(0).OpenRecordset("QSubscribers") rsSav.AddNew rsSav!LASTNAME = Me.tbLASTNAME rsSav!FIRSTNAME = Me.tbFIRSTNAME rsSav!AptNum = Me.tbAptNum rsSav!Spouse = Me.tbSpouse rsSav!Cell = Me.tbCell rsSav!LandLine = Me.tbLL rsSav!ImageName = Me.tbImageName rsSav!EMA = Me.tbEMA rsSav!Notes = Me.tbNotes rsSav.Update rsSav.Close Set rsSav = Nothing If bolSaveAct = True Then Set dbs = "c:\SDMA\SDMA-ActData.accdb" '<<<<<<< Put the name in SETTINGS after we learn how to do this 'Open the Subscriber table in the Activities DB Set rsActSub = dbs.OpenRecordset("tblSubscribers", dbOpenTable) '<SNIP> End If End If DoCmd.Close acForm, "frmProfile", acSaveYes End Sub