Hi there,
I try to use Findfirst to search for records.
However it only works when I use Findfirst with 1 criteria but not with 2 criteria.
Did I do something wrong?
Here is the code.
Thank you for your help
There are 2 tables, TRIAL_BALANCE and BILL_ITEMS tables.
In TRAIL_BALANCE, there are fields, table_id , category_id, amount and others
In BILL_ITEMS, there are fields, id, Cat_id, amount and others.
My function is similar to as below:
Private Sub btnEdit103_click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("TRIAL_BALANCE")
' table_id is in table TRIAL_BALANCE while id is in table BILL_ITEMS
' category_id is in TRIAL_BALANCE while Cat_id is in BILL_ITEMS
' BELOW LINE IS NOT WORKING AND NOT SHOW ANY RESULT
rs.FindFirst "[table_id]='" & Me.id & "' AND [category_id]=" & Me.Cat_id
' PROBLEM ON ABOVE LINE
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
I try to use Findfirst to search for records.
However it only works when I use Findfirst with 1 criteria but not with 2 criteria.

Did I do something wrong?

Thank you for your help

There are 2 tables, TRIAL_BALANCE and BILL_ITEMS tables.
In TRAIL_BALANCE, there are fields, table_id , category_id, amount and others
In BILL_ITEMS, there are fields, id, Cat_id, amount and others.
My function is similar to as below:
Private Sub btnEdit103_click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("TRIAL_BALANCE")
' table_id is in table TRIAL_BALANCE while id is in table BILL_ITEMS
' category_id is in TRIAL_BALANCE while Cat_id is in BILL_ITEMS
' BELOW LINE IS NOT WORKING AND NOT SHOW ANY RESULT
rs.FindFirst "[table_id]='" & Me.id & "' AND [category_id]=" & Me.Cat_id
' PROBLEM ON ABOVE LINE
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub