- Local time
- Today, 13:51
- Joined
- Aug 30, 2003
- Messages
- 36,157
Thanks, I agree. The VBA is where I get lost in this report. Where, specifically, would I put this?
Is this what you're looking for?
Thanks, I agree. The VBA is where I get lost in this report. Where, specifically, would I put this?
Don't remember if you said there's anything in the Default Value property but try replacing it with this.Current Date would be ideal.
It is defaulting to the last day in the FY End. That is what I need to figure out how to change.Don't remember if you said there's anything in the Default Value property but try replacing it with this.
=Date()
If you go to design view and select the box; in the properties window, what do you see in the default value property?It is defaulting to the last day in the FY End. That is what I need to figure out how to change.
It is blank.If you go to design view and select the box; in the properties window, what do you see in the default value property?
Sure thing. I hit save and it's still doing it. What. Am. I. Missing?!Great. Now, type this in there.
=Date()
That points to some code putting the date in there for you. You'll have to find out where it is. Do you know how to do that?Sure thing. I hit save and it's still doing it. What. Am. I. Missing?!
View attachment 94651
View attachment 94652
I'm in the VBA code, but I'm not super familiar so maybe it's not jumping out at me. Any pointers? I've searched the 8/31/2021, "Report Date", "default" and I'm not finding anything.That points to some code putting the date in there for you. You'll have to find out where it is. Do you know how to do that?
Maybe you could copy and paste the entire code page here, so we can examine it.I'm in the VBA code, but I'm not super familiar so maybe it's not jumping out at me. Any pointers? I've searched the 8/31/2021, "Report Date", "default" and I'm not finding anything.
Additional comment, the Report Date was changing automatically throughout FY21. So this is a new issue as we've come in to the new year.
Here are all the Subs under the Form code window. Let me know if this is not where I should be.Maybe you could copy and paste the entire code page here, so we can examine it.
The above part... Try changing it to this:Private Sub Form_Load()
Me!ReportDate.Value = DateSerial(Year(Date), Month(Date), 0)
Me!cboSchool.Value = "SOMED"
End Sub
Private Sub Form_Load()
'Me!ReportDate.Value = DateSerial(Year(Date), Month(Date), 0)
'Me!cboSchool.Value = "SOMED"
End Sub
Bingo! Thanks so much.The above part... Try changing it to this:
Basically, just add single quotes in front of those two lines. Then, make sure in the Default Value property of those two boxes, you have the following:Code:Private Sub Form_Load() 'Me!ReportDate.Value = DateSerial(Year(Date), Month(Date), 0) 'Me!cboSchool.Value = "SOMED" End Sub
For the "ReportDate" box, it should say: =Date()
For the "cboSchool" dropdown, it should say: "SOMED"
Hope that helps...
You're very welcome. We were all happy to assist. Good luck with your project.Bingo! Thanks so much.
Function GetFiscalYear(Dt As Variant, Optional StartMonth As Integer = 9) As Variant
If Not IsDate(Dt) Then Exit Function
If Month(Dt) >= StartMonth Then
GetFiscalYear = (Year(Dt) + 1)
Else
GetFiscalYear = Year(Dt)
End If
End Function
You would also be doing yourself a big favor if you added Option Explicit to the declarations.Option Compare Database
Private Sub cmdFYTDBUConstituentSummary_Click()
If Not IsDate(Forms![Development Report Manager]!ReportDate.Value) Then MsgBox "Please pick a Report Date!", vbOKOnly, Me.Caption: Exit Sub
If Me!cboSchool.List