473,412 Members | 5,361 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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)
ExitLine:
Exit Sub
ErrLine:
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
Variant
'
' 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
date.
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,
OpenArgs:=vStartDate

' 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
Else
CalendarDlg = IIf(IsDate(vPassedDate), vPassedDate, Null)
End If

ExitLine:
Exit Function
ErrLine:
Resume ExitLine
End Function"

John

Oct 13 '06 #1
0 1749

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ima Lostsoul | last post by:
I cant seem to set the date on the calendar control. What i want to happen is have a form pop up when a button is clicked (have that part of course). This for has a calendar control on it. I...
3
by: JingleBEV | last post by:
Hi all, I have a masked text control that would return a date in string format via the mask property like: "9/23/2004" and i have a calendar control that would pop up when I click a command...
5
by: Charles | last post by:
Hello, I would like for my users to have a calendar control only when needed. IE button click for the control to appear and then once the date is selected. Populate a text box and the calendar...
0
by: Robert Ladd | last post by:
Hi, I'm trying to disable the asp.net calendar control from a javascript function, but it doesn't disable the doPostBack. To simplify the situation, assume a page with 4 controls. A...
4
by: Kurt Schroeder | last post by:
I am trying to add a link button to a calendar. this is a simple example: Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles...
1
by: Peter | last post by:
I have a dilemna. Currently I have created a custom calendar webcontrol that a user can select and will dump the date along with some specialized information set in the tooltip. It actually is...
3
by: =?Utf-8?B?UGFycm90?= | last post by:
I applied the following Ajax code in my web page which has a calendar control to keep my page from completely reloading everytime something was changed. <atlas:ScriptManager ID="ScriptManager1"...
2
by: Sreenath Rao Nellutla | last post by:
Hai all, I am trying to create dropdown calendar control with HTML input control by writing JavaScript. But while executing I am getting the error as "Error on Page" on the status bar of the...
3
by: pavanik | last post by:
hey this is pavanik, i had created a pop up calendar control.it is working properly. but the problem is while i click on the button the calendar is displaying but if iam...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.