Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show parameter on form?

Status
Not open for further replies.
Feb 6, 2003
22
US
My form is based on a query that prompts for a start date and an end date. I want to show the dates in the header of the form. I have done this before but only in a report by setting the control source of a text box to "=[startdate]". When I try to do it this way in form it does not work - I get #Name?

How can I show the start date and end date on my form?

Thanks,

MB
 
MB,

Where does the value [StartDate] come from? If, as I suspect, the form's recordset; simply go to the design mode of the form and click the field list on the menu. Then click and drag the [StartDate] from the fieldlist to the form.

If this is not the case. Let me know.

rollie@bwsys.net
 
Rolliee,

Delivery Date is a field in the query. I have set the criteria for that field to: Between [StartDate] And [End Date], so start date does not appear in the field list

Hope this helps

Thanks,

MB
 
MB,

use the oncurrent event with the following code

Dim rs as dao.recordset
dim SQL as string

SQL = "qryYours"

set rs = currentdb.openrecordset(SQL)
rs.movefirst
do while not rs.eof
if rs![Somefield] = me.somevalue then
me.text0 = rs![StartDate]
exit do
endif

rs.close
set rs = nothing
exit sub

Further Quetions? Email me.

rollie@bwsys.net
rs.movenext
loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top