| | |
how do i use selectionformula using 2 fields
![]() |
•
•
Join Date: May 2005
Posts: 5
Reputation:
Solved Threads: 0
Hi,
Could anyone out there give me some help in using selectionformula or any other method in printing a report. I have designed a program in vb 6 and i want it to select flight No details and Date using crystal report 8. I have used the following code but i get type mismatch error
Dim ATMhist as CrystalReports
Dim ATMDate as Date
Set ATMhist = CrystalReport1
ATMDate = Format(txtHDate.Text, "YYYY,mm,dd")
ATMhist.SelectionFormula = "{TManifestHistory.date} = date ( " & ATMDate & " )" And "{TManifestHistory.FlightNo}='" & Combo2 & "'"
ATMhist.WindowState = crptMaximized
ATMhist.Action = 1
NB: I linked the crystal report control to the report file at design time
rgds,
Patrick
Could anyone out there give me some help in using selectionformula or any other method in printing a report. I have designed a program in vb 6 and i want it to select flight No details and Date using crystal report 8. I have used the following code but i get type mismatch error
Dim ATMhist as CrystalReports
Dim ATMDate as Date
Set ATMhist = CrystalReport1
ATMDate = Format(txtHDate.Text, "YYYY,mm,dd")
ATMhist.SelectionFormula = "{TManifestHistory.date} = date ( " & ATMDate & " )" And "{TManifestHistory.FlightNo}='" & Combo2 & "'"
ATMhist.WindowState = crptMaximized
ATMhist.Action = 1
NB: I linked the crystal report control to the report file at design time
rgds,
Patrick
I'm wondering if some of the properties to crystal require a specific data type:
ATMhist.SelectionFormula = "{TManifestHistory.date} = date ( " & ATMDate & " )" And "{TManifestHistory.FlightNo}='" & Combo2 & "'"
TManifestHistory.FlightNo, for example, might be expecting an integer, instead of a string (Returned from combo2), and if it's impartial to the data type, using combo2 without a specific property is a bad idea. Combo2.text would be a better solution to that. You might encase combo2.text with a val:
Hope that helps.
ATMhist.SelectionFormula = "{TManifestHistory.date} = date ( " & ATMDate & " )" And "{TManifestHistory.FlightNo}='" & Combo2 & "'"
TManifestHistory.FlightNo, for example, might be expecting an integer, instead of a string (Returned from combo2), and if it's impartial to the data type, using combo2 without a specific property is a bad idea. Combo2.text would be a better solution to that. You might encase combo2.text with a val:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
val(combo2.text)
Hope that helps.
![]() |
Similar Threads
- Passing variables into form fields (PHP)
- Editing/Creating PHP Fields - Novice! Help? (PHP)
- Populating a fields on a form base on a selected item from a droplist. (PHP)
- Loing authentication fields from 2 tables? (ASP)
- searching multiple fields (PHP)
- Add Fields to the Details View of Folders (Windows tips 'n' tweaks)
- Tab control on hidden input fields (HTML and CSS)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: about project
- Next Thread: VB Newbie Help pls
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






