to open a 2nd database use something like this:
as u see the msgbox can also display ur field from subform
just change ur strdb and add the code where u like to use it
this is loaded once at startup form calling displayform
Code:
Sub DisplayForm()
Dim strDB As String
Dim db1 As Database
Dim strSQL As String
Dim rs As Recordset
strDB = "C:\cctv\rownumbering.accdb" '2nd database not in use
Set db1 = OpenDatabase(strDB)
strSQL = "Select * from transactions where [customerid] = 5"
Set rs = db1.OpenRecordset(strSQL)
rs.MoveFirst
MsgBox rs.Fields("TransactionAmount") & "/" & rs.Fields("customerid") & Forms!form1![salary changes]!Name
End Sub
Private Sub Form_Load()
DisplayForm
End Sub