Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 Oracle
I hv created crystal report 8 in vb6....
 
I'm having cmbloc(combo box) shows list of locations,I did code to show that
 
if cmbloc is empty or has selected value then location field on crystal report sh'd display text as "all locations"..........
 
But error occurs : object required at the given line......
 
If particular code removed then location field shows by default location of first record.... plz help
 
Private Sub CmdRpt6_Click()
 SQL = "SELECT NOTE.*,LOCATION.LOC_NAME From NOTE,LOCATION "
 SQL = SQL + " Where NOTE.LOC_ID=LOCATION.LOC_ID"
 Set RS = CON.Execute(SQL)
 
 Report6.Database.LogOnServer "pdsORA7.dll", "soft", "", "aus", "aus123"
 Report6.DiscardSavedData
 
 If CmbLoc = Empty Or CmbLoc.Text = "<ALL LOCATIONS>" Then
   Report6.Field9.Value = "ALL LOCATIONS" // ERROR LINE : OBJECT REQUIRED
 End If
 Report6.SQLQueryString = SQL
 Report6.ReadRecords
 CRViewer1.ReportSource = Report6
 CRViewer1.ViewReport
End Sub
Posted 16-Apr-13 21:23pm
surkhi623
Edited 17-Apr-13 1:37am
v3
Comments
CHill60 at 17-Apr-13 7:06am
   
You're trying to set Field9.Value before Field9 exists. Try moving that code to after Report6.ReadRecords or adjust the SQL you are using - you are always getting every note regardless of location so it's not clear what the relevence of cmbLoc is
cool_sari at 17-Apr-13 8:30am
   
Moving that code after Report6.ReadRecords it's showing error as it was,even I'm unable to bind into sql......
n Bydefault location displays first note's location from the list of note records displayed...

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi
 
You can use parameter filed from Crystal Report and for do it please check the follow of links:
 
http://www.vb6.us/tutorials/using-crystal-reports-vb6-tutorial[^]
 
http://stackoverflow.com/questions/8034308/how-to-pass-parameter-field-to-command-query-in-crystal-reports-8-5[^]
 
you have another solution to get more information about it check it :
http://www.vbforums.com/showthread.php?431746-Crystal-Report-In-VB[^]
 
Best Regards.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 300
2 Sergey Alexandrovich Kryukov 289
3 CPallini 235
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 23 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100