Record Selection Formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have the folowing code

Dim y As New frmCobranz
Dim MyReport As New RPTCobranz
MyReport.DataDefinition.RecordSelectionFormula = "{CobH.RelNbr}= y.txtNoRelac.Text
CrystalReportViewer1.ReportSource = MyRepor

when run the report the following error rais

error in formula <record selection
'{cobh.relnbr}=y.txtnorelac.text
a number, currency amount, boolean, date, tieme or string is expected her

i don't know how to assign a value to a record selection formula
 
Hi Carmen,

I take it that cobh.relnbr is a table.column and that y.txtnorelac.text is a
textbox (although I don't understand the double dot part). In any event,
here's how to construct the recordselectionformula - it has to be values,
not variables. Thus:

"{CobH.RelNbr}= " & chr(39) & y.txtNoRelac.Text & chr(39)

Thus the formula would appear in crystal to be "{CobH.RelNbr}= '12345-009' "
(example of an account #).

HTH,

Bernie Yaeger
 
Hi Carmen,

Do a messagebox.show on relac and let me know what it looks like. also,
what is the data type of cobh.relnbr?

Bernie
 
Back
Top