467,150 Members | 1,126 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,150 developers. It's quick & easy.

My Calendar control button stopped working.

After opening and clicking on the popup calendar command control
button, "fdlgCal"; I click on a given date. The date is suppose to
then appear in a date field next to the control. Instead, I get the
following error:

"Microsoft Office Access

The expression On Click you entered as the event
property setting
produced the following error: The expression you
entered has a function
name that Microsoft Office Access can't find.

*The expression may not result in the name of a macro,
the name of a user-defined
function, or [Event Procedure].

* There may have been an error evaluating the function,
event, or macro."

Every thing use to work. My fear is that I changed one thing to many
during the process of debugging my whole application, and ended up
breaking this function.

Below is a description of how I have things set up:

1. I have a form called: "Employee"

2. It has a date field with the Control Source/Name: "startdte"

3. Next to this field is a calendar button named "Command100" with
an On Click Event Procedure written as follows:

"Private Sub Command100_Click()
On Error GoTo ErrLine
startdte = CalendarDlg(startdte)
Exit Sub
Resume ExitLine
End Sub"
4. Under my list of Modules; I have a module called "basCalDlg"
with the following Visual Basic Code:

"Option Compare Database 'Use database order for string comparisons
Option Explicit

Private Const cCalendarDialog = "fdlgCal"
'Const cModule = "basCalDlg"

Public Function CalendarDlg(Optional ByVal vPassedDate As Variant) As
' This is the public entry point.
' If the passed in date is missing (as it will be if someone just
opens the Calendar form),
' start on the current day. Otherwise, start with the date that is
passed in.
On Error GoTo ErrLine

Dim vStartDate As Variant

' If they passed a value at all, attempt to use it as the start
vStartDate = IIf(IsMissing(vPassedDate), date, vPassedDate)
' OK, so they passed a value that wasn't a date. Just use today's
date in that case, too.
If Not IsDate(vStartDate) Then vStartDate = date
DoCmd.OpenForm FormName:=cCalendarDialog, WindowMode:=acDialog,

' You won't get here until the calendar dialog is closed or hidden.
' If the calendar dialog is still loaded get the final chosen date
from the form.
' If it isn't, return Null.
If IsFormOpen(cCalendarDialog) Then
CalendarDlg = Forms(cCalendarDialog).Value
DoCmd.Close acForm, cCalendarDialog
CalendarDlg = IIf(IsDate(vPassedDate), vPassedDate, Null)
End If

Exit Function
Resume ExitLine
End Function"


Oct 13 '06 #1
  • viewed: 1549

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ima Lostsoul | last post: by
reply views Thread by Robert Ladd | last post: by
4 posts views Thread by Kurt Schroeder | last post: by
1 post views Thread by Peter | last post: by
3 posts views Thread by =?Utf-8?B?UGFycm90?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.