Hi,
I am kind of new at Access (pretty good with VBA I think :). I am
trying to retrieve data using SQL statement. I have a table with 5
field: ID (Access given), Card1, Card2, Group, Point.
I want to see other values based on Card1 and Card2. I think I can get
record with OpenRecordSet. I can print Count on that object and returns
1 (I think it should be). But i don't know how to use them. I tried
!Group but it is giving me error (I did with .FindFirst but it only
filter by one condition not multiple one) I got code:
Private Sub Card1_AfterUpdate()
Dim lsCard1 As String
Dim lsCard2 As String
Dim mySQL As String
Dim loDB As DAO.Database
Dim loRSPlayer As DAO.Recordset
Set loDB = CurrentDb()
lsCard1 = Card1.ItemData(Card1.ListIndex)
lsCard2 = Card2.ItemData(Card2.ListIndex)
'Get SQL
mySQL = "SELECT HandGroup.[Group] from HandGroup where Card1 = " &
lsCard1 _
& " AND Card2 = " & lsCard2
Set loRSPlayer = loDB.OpenRecordset(mySQL)
If Not loRSPlayer.EOF Then Me.Bookmark = loRSPlayer.Bookmark
End Sub
Thx