Since you did not indicate which database engine you are using (DAO, RDO or ADO). But this code will work any of the engine.
Step 1: install the CR.
Step 2: Open the CR to create your report. Create the fields by using CR formular
Step 3: save the report
Step 4: Open your program in VB
Step 5: Add the CR control by going through the menu (Project -> Components)
Step 6: Create a sub routine that will load the report.
Step 7: Add this code but you must modified it to your own.
note: the crtInvided is the name I give to the CR control
crtInVideo.DataFiles(0) = App.Path & "\InVideo.mdb" '
crtInVideo.ReportFileName = App.Path & "\cdaily.rpt"
crtInVideo.Formulas(0) = _
"CompanyName= '" & strCoy & "'"
crtInVideo.Formulas(1) = _
"ReportTitle='Cassette/CD Rented Today'"
crtInVideo.Formulas(2) = _
"Address= '" & strCoyAddress & "'"
crtInVideo.Action = 1
I hope this will useful to you.
Enter your message below
Sign in or Join us (it's free).