How to create a crystal report?
I have created a standard report with all data in it in Crystal Report 4.
Then I want to invoke it through a VB form. I used following different
ways to select only required data in that report. It's not working.
What is wrong with this?
what is the correct way?
Can I have the sample coding?
private sub command1_click()
Dim s As Integer
s = Val(InputBox("Please enter emp NUMBER"
)
Me.CrystalReport1.SelectionFormula = "{emp.empno} = " & s & " "
Me.CrystalReport1.Action = 1
end sub
This coding gives this error: Runtime error : "Unable to connect : Incorrect logon parameter"
And does not show the report.
OR sometimes it shows "Error in formula" which error i don't know
Or the following code:
Private sub command1_click()
Dim no As Integer
no = InputBox("Please enter emp Number"
Me.CrystalReport1.SQLQuery = "select * from emp where empno= " & no & ""
Me.CrystalReport1.Action = 1
end sub
This coding selects all the data from the table. I want to select only those
data which meets the runtime parameter.
Any suggestion will be very much helpful.
Thanks
macwan
I have created a standard report with all data in it in Crystal Report 4.
Then I want to invoke it through a VB form. I used following different
ways to select only required data in that report. It's not working.
What is wrong with this?
what is the correct way?
Can I have the sample coding?
private sub command1_click()
Dim s As Integer
s = Val(InputBox("Please enter emp NUMBER"
Me.CrystalReport1.SelectionFormula = "{emp.empno} = " & s & " "
Me.CrystalReport1.Action = 1
end sub
This coding gives this error: Runtime error : "Unable to connect : Incorrect logon parameter"
And does not show the report.
OR sometimes it shows "Error in formula" which error i don't know
Or the following code:
Private sub command1_click()
Dim no As Integer
no = InputBox("Please enter emp Number"
Me.CrystalReport1.SQLQuery = "select * from emp where empno= " & no & ""
Me.CrystalReport1.Action = 1
end sub
This coding selects all the data from the table. I want to select only those
data which meets the runtime parameter.
Any suggestion will be very much helpful.
Thanks
macwan