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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenating String and Variables

Status
Not open for further replies.

papaboy2

MIS
Jan 28, 2003
52
PH
hi, how can i concat a string and variable without displaying a single quote between them. the code below is concatenating "DATE" string and the text property of textbox. but when the report displays, it gives an output of "DATE '2004/01/02", when i try to remove one quote it generates and error
thanks a lot, help pls.

lReport.FormulaFields.GetItemByName("@Date").Text = "'Date '" & "'" & txtTxnDate.Text & "'"
 
Try:

lReport.FormulaFields.GetItemByName("@Date").Text = "'Date " & txtTxnDate.Text & "'"
or
lReport.FormulaFields.GetItemByName("@Date").Text = "'Date ' + totext(CDate('" & txtTxnDate.Text & "'), 'yyyy/MM/dd')"

The first one will just display the entire thing as one string, while the second one would allow you some flexibility as far as the Date format that displays on the report.

-dave
 
ok thank you very much i'l put that later, thanks again vidru
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top