Please help with this error, everytime i open a form from my switchboard and i click on one button(suppose to open another form) it throws the attached message on picture. My VBA code is :
Option Compare Database
Private Sub AddAppointment_Click()
Dim rsAppointments As Recordset
Dim strTime As String
Dim dtTime As Date
strTime = Form_AppointmentInformation.cboHour & ":" & Form_AppointmentInformation.cboMinute
Set rsAppointments = CurrentDb.OpenRecordset("Select * from Appointments")
rsAppointments.AddNew
rsAppointments.Fields(1) = Form_AppointmentInformation.AppointmentDate
rsAppointments.Fields(2) = Form_AppointmentInformation.cboHour & ":" & Form_AppointmentInformation.cboMinute
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
If RecordsetClone.RecordCount = 2 Then
MsgBox "Client made enough bookings and now qualifies for free voucher."
End If
End Sub
Private Sub Form_Load()
If RecordsetClone.RecordCount = 3 Then
Me.AllowAdditions = True
Me.AllowEdits = False
End If
End Sub