santastefano
Programmer
My application has conventional client files, First Name, Family Name
In addition it has students held in a separate table. I need to avoid the unlikely event of two brothers attending the same session.
qryCheckClient works and returns required information.
qryClientID updates the student table.
Returns error message Type mismatch
DAO is selected in type libraries.
Also tried a list box that retrieves First Name, Last Name and ID Number together with text boxes (=[ListBoxName].[Column],0) but the ListBox always selects the first example found.
Any help gratefully received.
In addition it has students held in a separate table. I need to avoid the unlikely event of two brothers attending the same session.
qryCheckClient works and returns required information.
qryClientID updates the student table.
Code:
Dim rsCheckClient As DAO.Recordset
Dim db As DAO.Recordset
Set db = CurrentDb
Set rsCheckClient = db.OpenRecordset("qryCheckClient", dbopendynaset)
rs.Open "CheckClient"
If Not rsCheckClient.BOF And Not rsCheckClient.EOF Then
DoCmd.OpenQuery "qryClientID"
Else
Reply = MsgBox("There is no record of this student", 64, "School Run")
DoCmd.CancelEvent
DoCmd.GoToControl "LastName"
Me.FirstName = ""
Me.LastName = ""
End If
rsCheckClient.Close
Set rsCheckClient = Nothing
Set db = Nothing
DAO is selected in type libraries.
Also tried a list box that retrieves First Name, Last Name and ID Number together with text boxes (=[ListBoxName].[Column],0) but the ListBox always selects the first example found.
Any help gratefully received.