Susan Harkins
ssharkins at bellsouth.net
Fri Apr 23 09:41:23 CDT 2004
Back to the function though -- I wanted to avoid it. I plan to hock a
follow-up. ;)
Susan H.
Hi Susan
> My final solution is to refer to the form value in the query. This
> time around, I hid the report, forcing the user to use the form to
> open the report, but that isn't the best way to do it. Unfortunately,
> I didn't know how to ward off the dread parameter prompt when the user
> opens the report naturally instead of through the form. I've no
> problem setting a default for the sort, but couldn't stop that stupid
> prompt because it's coming from the query. :(
If that was your only problem (of this thread, of course), you could replace
the parameter lookup with a tiny public function performing the lookup:
<air code>
Function GetReportWeekday() As Byte
Const cstrForm As String = "frmYourForm"
' Default first weekday.
Const cbytWeekday As Byte = vbSunday
Dim bytWeekday As Byte
If IsFormOpen(cstrForm) Then
bytWeekday = Val(Nz(Forms(cstrForm)!txtYourTextbox.Value,
vbNullString))
EndIf
If bytWeekday = 0 Then
bytWeekday = cbytWeekday
Endif
GetReportWeekday = bytWeekday
End Function
</air code>
/gustav
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com