How to put a calendar on a date field in Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm new to Access and need to have a calendar to automatically popup, when
selected, to enter a date into a date field.

I put an ActivX control next to the field and it works but I don't want to
see the calendar unless the user requests it.

Can someone help me?
 
Put a button beside your date field to open a pop-up form with a calendar on
it. Use the following code:
DoCmd.OpenForm "NameOfCalendarForm",,,,,acDialog
Me!NameOfDateField = Forms!NameOfCalendarForm!NameOfCalendarControl.Value
DoCmd.Close acForm, "NameOfCalendarForm

On your calendar form, put the following code in the AfterUpdate event of
the calendar control:
Me.Visible = False
 
Hi PCD,

I'll try that!

Thanks!

PC Datasheet said:
Put a button beside your date field to open a pop-up form with a calendar on
it. Use the following code:
DoCmd.OpenForm "NameOfCalendarForm",,,,,acDialog
Me!NameOfDateField = Forms!NameOfCalendarForm!NameOfCalendarControl.Value
DoCmd.Close acForm, "NameOfCalendarForm

On your calendar form, put the following code in the AfterUpdate event of
the calendar control:
Me.Visible = False

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 
Hi Jeff,

I'll take a look at them!

Thanks,

Jeff Conrad said:
My advice would be to lose the ActiveX calendar control and
use MVP Stephen Lebans' slick calendar here:

http://www.lebans.com/monthcalendar.htm

Instructions are included on the site.

I have some other calendar options listed here as well:

http://home.bendbroadband.com/conradsystems/accessjunkie/calendars.html

Choose number one.
;-)

--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html


in message:
 
Hi PC,

Please forgive my lack of experience here! I tried adding the button but it
gave me a list of types ( i.e. Record navigation...Forms Operations etc ).
which one do I choose? I need a step-by-step guide if possible!

Thanks for you well appreciated help!
 
1. Open your form in design view and select the button.
2. Click on the Properties icon in the menu at the top of the screen.
3. In the Properties dialog, click on the Events tab.
4. Click in the box for the Click event.
5. Click on the button with the three doys at the far right
6. In the Choose Builder dialog, Click on Code Builder then Click OK.
7. You will see something like:
Private Sub Command15_Click()

End Sub
Type the code I gave you between these two lines. Be sure to use the
actual name of your calendar form, the actual name of your date field and
the actual name of the calendar control
8. Close everything.

For the line in your calendar form, follow the same procedure after opening
the calendar form and seleting the calendar control.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 
Hi PCD,

Here's what I have for my button but I get a syntax error on the ME!.... line.

Private Sub Command43_Click()

DoCmd.OpenForm "AP_CalendarForm", , , , , acDialog
Me!SP_AP_DATE = Forms!AP_CalendarForm!Calendar Control 11.0.Value
DoCmd.Close acForm, "AP_CalendarForm "

On Error GoTo Err_Command43_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70

Exit_Command43_Click:
Exit Sub

Err_Command43_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command43_Click

End Sub
 
Thanks Jeff,

Your calendar demo was awsome in helping work with my form and to begin to
understand the editor as well.

Thanks man,

Greg
 
Put "Calendar Control 11.0" in square brackets. Any time a n Access object
name contains one or more spaces, it need to be enclosed in square brackets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top