Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

allen browne's calender modification

Status
Not open for further replies.

officemanager2

Technical User
Oct 11, 2007
116
0
0
CA
Came across Allen Browne's site and it is great. I've gotten a calender function from the site and can incorporate it into my form as it appears from Browne's site just fine.

The code is set up that one pushes a button the calender opens, date is selected and entered into a field.

The issue is I don't want the calender to have to launch from a button, I would rather the calender always be present on the form instead of being a subform.

I've tried to cut and paste the calender right on to the form but cannot get it to work from there because it seems that the launch button must be pushed (clicked) to get it to work.

VBA to open the calender form:

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

Any Suggestions?
 
Copy the On_click code for the launch button into the On_open event for your form?

Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
I'm trying that but not having much success, still working on it though.

I'm wondering how one takes an existing form and essentially puts it into a new form but as it's individual pieces. I'm trying to relink/import the calender but it is initially a subform so this is proving troublesome.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top