K
KC
I have a form with two unbound combo boxes from which a user selects a
month and year of interest. The form also has textboxes whose control
sources are populated with the names of fields in my (as yet unrun)
stored procedure (actually it's a function). The form itself does not
have a recordsource defined.
There is also a command button on the form:
Private Sub Command4_Click()
Dim ldStrtDate As Date, ldEndDate As Date
Me.RecordSource = ""
Call GetDates(ldStrtDate, ldEndDate)
Me.InputParameters = "@StrtDate = '" + Format(ldStrtDate) +
"',@EndDate = '" + Format(ldEndDate) + "'"
Me.RecordSource = "fn_GetSumbyDate"
Me.Refresh
End Sub
Now, everthing works absolutely perfectly as long as the dates selected
by the user are valid (ie there are records in the tables that fall
within the specified dates). However, if the dates specified result in
no records being returned from the function, ALL FIELDS DISAPPEAR FROM
THE FORM.
Why?
How to fix?
Thanks in advance,
KC
month and year of interest. The form also has textboxes whose control
sources are populated with the names of fields in my (as yet unrun)
stored procedure (actually it's a function). The form itself does not
have a recordsource defined.
There is also a command button on the form:
Private Sub Command4_Click()
Dim ldStrtDate As Date, ldEndDate As Date
Me.RecordSource = ""
Call GetDates(ldStrtDate, ldEndDate)
Me.InputParameters = "@StrtDate = '" + Format(ldStrtDate) +
"',@EndDate = '" + Format(ldEndDate) + "'"
Me.RecordSource = "fn_GetSumbyDate"
Me.Refresh
End Sub
Now, everthing works absolutely perfectly as long as the dates selected
by the user are valid (ie there are records in the tables that fall
within the specified dates). However, if the dates specified result in
no records being returned from the function, ALL FIELDS DISAPPEAR FROM
THE FORM.
Why?
How to fix?
Thanks in advance,
KC