Use .seek with 2 Tables
Good Morning.
I am working on the following code. on this, I am looking at one table. but I need to looking at 2 tables
Can you help me?
MS Access 2003
Private Sub MEMBERSHIPCOUNT_GotFocus()
Dim db As Database, tb1 As Recordset
Dim esvar As Variant
Set db = DBEngine.Workspaces(0).Databases(0)
Set tb1 = db.OpenRecordset("BreakLunchSnack")
tb1.MoveFirst
With tb1
.Index = "school"
esvar = .Bookmark
.Seek "=", [School], [Date]
If .NoMatch Then
MsgBox (School + " & " + CStr(Date) + " doesn't exist ")
Date.SetFocus
Else
MsgBox (!School & " Date: " & !Date & " Record Num: " & !RecNum & " Total Breakfast: " & !BTLStudents & " Lunch: " & !LTLStudents)
End If
tb1.Close
End With
End Sub
-
Official comment
Hello Frank,
What are you trying to do? Have you tried creating a query that links the two tables with a WHERE clause rather than issuing the seek command?
Please let us know and we can update you further.
Thank you,
Tech Support
Comment actions
Please sign in to leave a comment.
Comments
1 comment