Calendar and records

  • Thread starter Thread starter Gcood
  • Start date Start date
G

Gcood

Guest
I am trying to create a shift scheduler for my worksite. I have a form with the calendar on it. I have managed to create code that limits the dates that can be scheduled. This is done in Before Update. What I need now is to go to the record based on the date chosen on the calendar.

I've tried using:

[Date].value = [Calendar].value

This did change the date field to the calendar date chosen, but it did not go to the record associated with that date.

What am I missing here?
 
If you have a field named Date then you should change it, it's a reserved word in access and will cause problems. The easiest way to do what you want is to get the button wizard to create the button and copy the code it creates.
HTH
 
Looks like were working on the same project. This works for me.

'***********************************
'NAVIGATING USING THE CALENDAR
'***********************************

Private Sub DutyCalendar_Click()
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "MyForm"
stLinkCriteria = "Duty_Date=" & DutyCalendar.Value

DoCmd.OpenForm stDocName, , , stLinkCriteria


End Sub

J-F
 

Users who are viewing this thread

Back
Top Bottom