i have a hard time in connecting my db to my project.
cause i want my my cmdSearch_click() connect to my table EmployeeInfo
and my cmdTimeIn_click() connect to my table TransactionTable in just 1 form and 1 ms access file..

is that possible??


thanks in advance for answering..

Yes it's possible, just declare two recordset objects..

and then open those tables on the event that you want...

Dim rsEmpInfo As New ADODB.Recordset
Dim rsTransTbl As New ADODB.Recordset

Private Sub cmdSearch_Click()
 With rsEmpInfo
    If .STate = adStateOpen Then .Close
        'Open the table
       .Open "SELECT * FROM EmployeeInfo WHERE FieldNameHere='" & Me.txtSearch.Text & "'", cn, adOpenKeyset, adLockOptimistic, adCmdText
 End With

End Sub

'The same goes with the cmdTimeIn_Click()

If you still have any questions, just ask... :) Goodluck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.