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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PoP Up Calendar

Status
Not open for further replies.

churdle

Programmer
Joined
Apr 2, 2000
Messages
7
Location
US
i'm sure everyone has seen this before....but what is the best way to have a pop-up calendar for a date field...should i use the ActiveX?....i'm using Access 2000....and also...what are the conventions for pop-up calendars??....should they dissappear when they lose focus, etc....anyone out there have a good set of criteria or settings?...thanks<br>
 
Staying in view or disappearing could depend on how much space you have on your form. Little space make it disappear.<br>Also If you make it disappear you could put it on a separate form that pops up. The form would be &quot;modal&quot; (you have to do something to it before it will go away).<br>But if its separate you have to refer to the Calendar <br>like so = Forms![frm-Calendar]!ActiveXCtl0.Value<br><br>I created a button on one form which opened another form with a calendar control on it.<br>--------------------------<br>Private Sub Command8_Click()<br>On Error GoTo Err_Command8_Click<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Dim stDocName As String<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim stLinkCriteria As String<br><br>&nbsp;&nbsp;&nbsp;&nbsp;stDocName = &quot;frm-Calendar&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenForm stDocName, , , stLinkCriteria<br><br>Exit_Command8_Click:<br>&nbsp;&nbsp;&nbsp;&nbsp;Exit Sub<br><br>Err_Command8_Click:<br>&nbsp;&nbsp;&nbsp;&nbsp;MsgBox Err.Description<br>&nbsp;&nbsp;&nbsp;&nbsp;Resume Exit_Command8_Click<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>End Sub<br>--------------------------<br><br>Then the form with the calendar I turned off:<br>Navigation buttons<br>Record Selectors<br>Dividing lines<br>I set modal &quot;Yes&quot;<br><br>I made the form just big enough to show the calendar and one button I labeled &quot;OK&quot;<br>So you pick your date, then click OK, the calendar form disappears leaving a date in a text box on the calling form.<br>-----------------------------<br>Private Sub Command1_Click()<br>On Error GoTo Err_Command1_Click<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Forms![form1]!Text5 = Forms![frm-Calendar]!ActiveXCtl0.Value<br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.Close acForm, &quot;frm-Calendar&quot;<br><br>Exit_Command1_Click:<br>&nbsp;&nbsp;&nbsp;&nbsp;Exit Sub<br><br>Err_Command1_Click:<br>&nbsp;&nbsp;&nbsp;&nbsp;MsgBox Err.Description<br>&nbsp;&nbsp;&nbsp;&nbsp;Resume Exit_Command1_Click<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>End Sub<br>--------------------------<br>OK<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top