Hi Guys
Happy New Year
I have a resourcing database which has a form created from a crosstab query with the dates of every working date between January 2014 and December 2020 as its left hand column. By default the form opens at todays date and I have created a refresh (actually requery) button with the same functionality. I would also like to create a form jump function where if a user picks a year and a month the form can go directly to that point.
The code I have written is this
The code does exactly what I want but I don't much fancy copying it line by line for every month between now and December 2020. Am I missing a trick? I am sure I am but I need prodded in the right direction.
Any help is, as always, much appreciated.
Happy New Year
I have a resourcing database which has a form created from a crosstab query with the dates of every working date between January 2014 and December 2020 as its left hand column. By default the form opens at todays date and I have created a refresh (actually requery) button with the same functionality. I would also like to create a form jump function where if a user picks a year and a month the form can go directly to that point.
The code I have written is this
Code:
Private Sub Command5_Click()
If [Cmb_Year] = "2014" And [Cmb_Month] = "January" And Environ("username") = "mo096560" Then
With [Forms]![frmOperationalTrainers]
.Requery
.Recordset.FindFirst "Start_Date =" & SQLDate(#1/31/2014#)
End With
End If
End Sub
The code does exactly what I want but I don't much fancy copying it line by line for every month between now and December 2020. Am I missing a trick? I am sure I am but I need prodded in the right direction.
Any help is, as always, much appreciated.