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

Date in Textfield

Status
Not open for further replies.

Informatic

Programmer
Oct 4, 2002
34
DE
Hallo

I have a textfield (format : date) with month and year.

I just want to make a form (like calendar),where the user select month and year.When the user try to enter data in the textfield the form will become visible and he can choose month and year. The selected month and year have to be writen then in the textfield.....

..................
 
Hi

I would advise looking at the calendar control (Microsoft Calendar Control 9.0 if Access2000)

1. Create a form with the calendar control on it and a close button

2. in the close event of the calendar form have this code:
strDate = ctlCalendar.Value
DoCmd.Close
3. I made strDate a public variable in the database (although you could probably get round this
4.In the event that you want to trigger the calendar

txtValidDateTo.SetFocus ' name of filed where date is to go
If txtValidDateTo.Text = "" Then
strDate = Now()
Else
If IsDate(txtValidDateTo.Text) = False Then
strDate = Now()
Else
strDate = txtValidDateTo.Text
End If
End If

DoCmd.OpenForm "frmCalendar", , , , , acDialog

txtValidDateTo.Text = strDate

5. Ensure that calendar form is modal.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top