One more question .. I have the following code
Set Rst = db.OpenRecordset("Select DISTINCT Species from tblPlots where
Compartment = '" & [Forms]![frmSummarize]![cboComp] & "' and Stand = '"
& [Forms]![frmSummarize]![cboStand] & "'", dbOpenSnapshot)
Rst.MoveLast
Me("txtNumPlots").ControlSource = Rst.Recordcount
rs.Close: Set rs = Nothing
Rst.Close: Set Rst = Nothing
that also comes up with a parameter box asking for input and once you
put something in there it shows up on the report but otherwise does
not.. and this is one that i have done before with the exception being
that instead of the select statement I just used the Me.RecordSource of
the report itself.. TIA
Marshall said:
Brian wrote:
I already figured out another way but the question I have is in the
report open how come the following code comes up with a parameter box
asking for input
Me("txtNumOfTrees").ControlSource = DCount("UNITID", "tblPlots",
"Compartment = '" & [Forms]![frmSummarize]![cboComp] & "' and Stand =
'" & [Forms]![frmSummarize]![cboStand] & "' ")
Because the result of the DCount is not a record source
field name.
I would probably set a label control's Caption property
instead of a text box's ControlSource property.
If you really need to use a text box's ControlSource, then
you can set it to an expression by concatenating the DCount
value to an = sign.
Me("txtNumOfTrees").ControlSource = "=" & DCount(...