Dear All,
This is my first post and i am begnier level in crystal report. i am using cr 8.5, vb6 & MS Access 2007.
My problem is that when i am trying to fetch data from access with the help of formula i receive this error:
A number, currency amount, boolean, date, time, date-time, or string is expected here.
this is my code as mentioned below:
Me.MousePointer = vbHourglass
If Combo1.Text = "" Then
Inventrymain.cr1.ReportFileName = App.Path + "\chartofaccounts.rpt"
Inventrymain.cr1.Connect = ";Pwd=" & "system"
Inventrymain.cr1.RetrieveDataFiles
Inventrymain.cr1.DiscardSavedData = True
Inventrymain.cr1.ReportSource = 0
Inventrymain.cr1.WindowTitle = " Chart of Items "
strformula = "{subcodes.accode}<> 0 "
Inventrymain.cr1.ReplaceSelectionFormula (strformula)
Inventrymain.cr1.WindowState = crptMaximized
Unload Me
On Error Resume Next
Inventrymain.cr1.Action = 1
Else
Inventrymain.cr1.ReportFileName = App.Path + "\chartofaccounts.rpt"
Inventrymain.cr1.Connect = ";Pwd=" & "system"
Inventrymain.cr1.RetrieveDataFiles
Inventrymain.cr1.DiscardSavedData = True
Inventrymain.cr1.ReportSource = 0
Inventrymain.cr1.WindowTitle = " Chart of Items "
strformula = "{subcodes.accode} = " & Combo2.Text & ""
Inventrymain.cr1.ReplaceSelectionFormula (strformula)
Inventrymain.cr1.WindowState = crptMaximized
Unload Me
On Error Resume Next
Inventrymain.cr1.Action = 1
End If
Private Sub Form_Load()
con
Set rs = cn.Execute("select Distinct accode,acname from subcodes order by accode")
Do While Not rs.EOF
Combo1.AddItem rs(0) & " - " & rs(1)
Combo2.AddItem rs(0)
rs.MoveNext
Loop
End Sub
in access database accode & acname all are text string.
please help me about this issue.
thnx in advance