View Full Version : Accessing multiple table data in a form


Kwurz
05-31-2001, 06:38 AM
I am trying to access a records from a table(in the same db) that is different from the one my form is connected with. Is their an easy way to do this.
My Current Code:
Option Compare Database
Option Explicit

Private Sub Validate_LostFocus(Cancel As Boolean)
Dim SQLtext, var1 As Recordset, var2, var3
SQLtext = "SELECT * FROM [Activity_Index] WHERE " _
& "Activity_Index![ID] = " & Me![ID]
Set var1 = CurrentDb.OpenRecordset(SQLtext)
var2 = Me.School
var3 = var1![School]
If var2 <> var3 Then
MsgBox "Please Try Again"
Cancel = True
End If
End Sub