0

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..

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by PoisonedHeart
0

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!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.