by Kevin E. Luckett (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 27th February 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
If you want to pass data to from a VB form to Crystal Reports 8.5, use this method. This snippet allow you to type in whatever you want on a
'you want.
'I use basic for language, so select it from top right drop down. Here is what
'I put in the formula:
Dim x as String 'This is for sting data only. Adjust if you need to.
x = " " 'Make sure you put a space between the quotes (" ")
formula = Trim(x)
'That it for the formula, now save it
'Now open VB and add the crystalreport1 to the form
'Now add a command button to the form
'Double click the command buttom to get to the code window
'I us this to connect to the Crystal Report I just created.
CrystalReport1.ReportFileName = App.Path & "\reports\ReportnameHERE.rpt"
CrystalReport1.Connect = "DSN=Whatever; UID=Administrator;PWD=whaterver"
'Put your DSN and PWD where it says whaterver
'All the formulas you create on your crystal Report form are Array(s) starting
'with 0
'The order of your formulas in Crystal Report determines the array number
'If you have one formula then use this::
CrystalReports1.Formulas(0) = "name of formula= " & Chr(34) & txtboxename & Chr(34)
'Now show the report
CrystalReport1.action = 1
'Sweet Huh....
'Good Luck
No comments have been posted about If you want to pass data to from a VB form to Crystal Reports 8.5, use this method. This snippet al. Why not be the first to post a comment about If you want to pass data to from a VB form to Crystal Reports 8.5, use this method. This snippet al.