Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Popup Calendar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan Lars - 11 Jan 2008 20:16 GMT
The popup calendar I downloaded from Allen Browne's site worked in one
Database perfectly, but after I importing it into 2 other databases since
then it has not worked.  Ithas to be user error, but I can't figure it out.  
I receive the following message after replacing the StartDate text in the
provided On-Click Event Procedure in the Properties List with my text box
name:

"There was an error compiling this function.
The Visual Basic Module contains a syntax error.
Check the code, and then recompile it."

What am I missing?

http://allenbrowne.com/ser-51.html
Daniel Pineault - 11 Jan 2008 20:46 GMT
This may be a stupid question, but...

you mention import the form, but did you import the ajbCalendar module as
well?
Signature

Hope this helps,

Daniel Pineault

> The popup calendar I downloaded from Allen Browne's site worked in one
> Database perfectly, but after I importing it into 2 other databases since
[quoted text clipped - 10 lines]
>
> http://allenbrowne.com/ser-51.html
Nathan Lars - 11 Jan 2008 20:51 GMT
Yes, the module too.  I also copied the button into my form.

> This may be a stupid question, but...
>
[quoted text clipped - 15 lines]
> >
> > http://allenbrowne.com/ser-51.html
Daniel Pineault - 11 Jan 2008 21:02 GMT
Just the button?

Did you enter

Public gtxtCalTarget As TextBox

in the form module header?

What is the code behind you button?

When you compile the code in the VBE does it compile properly?
--
Daniel Pineault

> Yes, the module too.  I also copied the button into my form.
>
[quoted text clipped - 17 lines]
> > >
> > > http://allenbrowne.com/ser-51.html
Nathan Lars - 11 Jan 2008 22:47 GMT
I am sorry I don't understand your questions as well as I would like since my
knowledge of Access is fairly basic.  I don't mean to frustrate you, but what
do you mean by "Public gtxtCalTarget As TextBox"?  The calendar should be
pointing to the existing Text Box in my form?  My Text Box name is Project
Open, which is what I replaced for txtStartDate in the existing event
procedure for On Click.

Before:
=CalendarFor([txtStartDate],"Set the start date")

After:
=CalendarFor([Project Open],"Set the start date")

This is so it opens a calendar for the Project Open text box, right?  In a
different db it worked.  Does that answer your question about the code behind
my calendar button?
I didn't actually go into VBE to change the code, I just changed it in the
On Click field in the properties list for the Project Open text box.

Thank you for your help.

> Just the button?
>
[quoted text clipped - 31 lines]
> > > >
> > > > http://allenbrowne.com/ser-51.html
Daniel Pineault - 11 Jan 2008 22:55 GMT
Nathan,

You're not frustrating me.  We all have questions and we were all new to
access at one time or another!

but what do you mean by "Public gtxtCalTarget As TextBox"?  
Well, it hard to explain so best bet is to open the sample database from
Allen's website and open the frmExample in design mode.  Select the
cmdCalDate button and right-click on it and select build event from the list.
This will open the VBE at the code for that button.  Now scroll to the top
of the page for that module.

It should look like:
Option Compare Database
Option Explicit

'Calendar form variable:
Public gtxtCalTarget As TextBox 'Text box to return the date from the
calendar to.

Public Function CalendarFor(txt As TextBox, Optional strTitle As String)
...

Now perform the same operation on your form and button.  Check the module
page header (top of the page).  Does it have the

'Calendar form variable:
Public gtxtCalTarget As TextBox 'Text box to return the date from the
calendar to.

at the very top before any function/sunroutine declarations? If not, please
add it, compile and save your changes and try it again.
Signature

Hope this helps,

Daniel Pineault
If this post was helpful, please rate it by using the vote buttons.

> I am sorry I don't understand your questions as well as I would like since my
> knowledge of Access is fairly basic.  I don't mean to frustrate you, but what
[quoted text clipped - 52 lines]
> > > > >
> > > > > http://allenbrowne.com/ser-51.html
Nathan Lars - 11 Jan 2008 23:12 GMT
Yes it shows exactly as you described.  Below was copied straight from file
downloaded from Allen's site.
See anything wrong?

...
Option Compare Database
Option Explicit

'Calendar form variable:
Public gtxtCalTarget As TextBox 'Text box to return the date from the
calendar to.

Public Function CalendarFor(txt As TextBox, Optional strTitle As String)
'On Error GoTo Err_Handler
   'Purpose:   Open the calendar form, identifying the text box to return
the date to.
   'Arguments: txt = the text box to return the date to.
   '           strTitle = the caption for the calendar form (passed in
OpenArgs).
   
   Set gtxtCalTarget = txt
   DoCmd.OpenForm "frmCalendar", windowmode:=acDialog, OpenArgs:=strTitle
   
Exit_Handler:
   Exit Function

Err_Handler:
   MsgBox "Error " & Err.Number & " - " & Err.Description, vbExclamation,
"CalendarFor()"
   Resume Exit_Handler
End Function

Public Function LogError(lngErr As Long, strDescrip As String, strProc As
String, _
   Optional bShowUser As Boolean = True, Optional varParam As Variant)
   'Purpose: Minimal substitute for the real error logger function at:
   '               http://allenbrowne.com/ser-23a.html
   
   If bShowUser Then
       MsgBox "Error " & lngErr & ": " & strDescrip, vbExclamation, strProc
   End If
End Function
...

> Nathan,
>
[quoted text clipped - 85 lines]
> > > > > >
> > > > > > http://allenbrowne.com/ser-51.html
Daniel Pineault - 11 Jan 2008 23:36 GMT
The question is at the top of your forms module does it begin with
...

Option Compare Database
Option Explicit

'Calendar form variable:
Public gtxtCalTarget As TextBox 'Text box to return the date from the
calendar to.

...

if not, it should!

Have you compacted and repaired your database lately?
Signature

Hope this helps,

Daniel Pineault
If this post was helpful, please rate it by using the vote buttons.

> Yes it shows exactly as you described.  Below was copied straight from file
> downloaded from Allen's site.
[quoted text clipped - 129 lines]
> > > > > > >
> > > > > > > http://allenbrowne.com/ser-51.html
Nathan Lars - 11 Jan 2008 20:58 GMT
I just tried to click the button off of the frmExample in forms from the
original downloaded file and it gives me an error message:

"Microsoft Visual Basic
Run-time Error '438':

Object doesn't support this property or method"

[End]  [Debug]

> This may be a stupid question, but...
>
[quoted text clipped - 15 lines]
> >
> > http://allenbrowne.com/ser-51.html
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.