DianeandChipps said:
Many thanks Wayne, I was given the link to the calendar in one of the Access
newsgroups, it is
http://members.iinet.net.au/~allenbrowne/ser-51.html I have
entered the validation rule =date() or >date() into the booking table without
it updating the previous entries (as they are in the past). Now if I try to
enter a date in the past using the popup calendar the date text box stays
blank but if I type in a date in the past I get the validation text. I am
still quite new to access so simple answers would be appreciated,
I've just tested Allen Browne's Calendar control and found a small bug that
is surpressing the error message from the Validation Rule.
You will need to open the form called frmCalendar in the Visual Basic Editor
to fix this.
Locate the procedure 'cmdOk_Click' which looks like this:
----------------------------------------------------------------------------
------------------
Private Sub cmdOk_Click()
On Error Resume Next
'Purpose: Transfer the result back to the calling text box (if there
is one), and close.
If gtxtCalTarget = Me.txtDate Then
'do nothing
Else
gtxtCalTarget = Me.txtDate
End If
gtxtCalTarget.SetFocus
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub
----------------------------------------------------------------------------
------------------
And replace with what's here:
----------------------------------------------------------------------------
------------------
Private Sub cmdOk_Click()
'Purpose: Transfer the result back to the calling text box (if there is
one), and close.
On Error GoTo ErrorHandler:
If Not gtxtCalTarget Is Nothing Then
If gtxtCalTarget = Me.txtDate Then
'do nothing
Else
gtxtCalTarget = Me.txtDate
End If
gtxtCalTarget.SetFocus
End If
DoCmd.Close acForm, Me.Name, acSaveNo
Exit Sub
ErrorHandler:
MsgBox Err.Description
End Sub
----------------------------------------------------------------------------
------------------
I've copied this message to Allen's e-mail so hopefully it can be fixed for
future.
Regards,
Wayne Phillips
http://www.everythingaccess.com