Calendar select date record

  • Thread starter Thread starter Smiles
  • Start date Start date
S

Smiles

Good day

I have a Access database with a record for each day of the year each
records has about 130 data elements

From this I have created 12 forms which contain the relative data elements

I would like to place the default calendar at the top of each form
click on a day on the calendar had have the form bring up that days
records so the can be updated or verified
can you tell me where to start

thanks
 
Why don't you base your form records on a query that will prompt user to
enter a date window for the date field you choose. Then the form will open
only showing records in the specified date window.
 
Smillie :),

insert the Calendar Control as, say ,"MyCalendar" anywhere on you form and
use the On Current event:

+++++++++
Private Sub Form_Current()

If IsNull(Me.SomeDate) Then

With Me.MyCalendar
.Year = Year(Date)
.Month = Month(Date)
.Value = Date
End With

Else

With Me.MyCalendar
.Year = Year(Me.SomeDate)
.Month = Month(Me.SomeDate)
.Value = Me.SomeDate
End With

End If

End Sub
++++++

'(you cannot use an IF statement *inside* a With statement)

If you want to change the date using the calendar, eg clicking on a date on
your Calendar control, use the After Update event of the Calendar:

++++++

Private Sub MyCalendar_AfterUpdate()

Me.SomeDate=Me.MyCalendar.Value

End Sub

+++++

Regards/JK
 
Smiles said:
Good day

I have a Access database with a record for each day of the year each
records has about 130 data elements

From this I have created 12 forms which contain the relative data elements

I would like to place the default calendar at the top of each form
click on a day on the calendar had have the form bring up that days
records so the can be updated or verified
can you tell me where to start

thanks
Thank you for the advise but I only have these options to set a value of
the date

on update
on enter
on exit
on get focus
on lost focus

where do I put your code

thanks
 

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

Similar Threads

Updated records in forms 1
Calendar Color 2
calendar showing multiple months 4
Check if a date exists in a record 1
Outlook-like Calendar 6
Remember the Date 4
Special Calendar 3
build a calendar 1

Back
Top