Display different fields in VB Data Report
85 pts.
0
Q:
Display different fields in VB Data Report
In VB Data report based on the option selected from Form,
the same data report should display different fields.
For eg, when I choose "Tution Fees" it should display tution fees only, When I choose "book fees" it should display book fees only.
I am using dataenvironment as dat source
ASKED: Nov 25 2008  4:06 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
29830 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
If you really mean different fields(not different records), I think you will need to dynamically change the command text of the query.

I don't know how you are going to design the form to let the user choose what information to see, but for this example, I will assume that you have two buttons, one to show the "tuition fees", and one for the "book fees".

I will assume column an table names as well.

Private Sub btnTuition_Click()
If DataEnvironment1.rsCommand1.State Then
DataEnvironment1.rsCommand1.Close
End If
DataEnvironment1.Commands(1).CommandText = _
"select tuition_fees as fee from fees_table where ..." ' put the necessary conditions here
DataReport1.Show vbModal
End Sub


Private Sub btnBook_Click()
...
DataEnvironment1.Commands(1).CommandText = _
"select book_fees as fee from fees_table where ..." ' put the necessary conditions here
...
DataReport1.Show vbModal
End Sub


For this example, you should use fee as the DataField property of you rptTextBox (in the DataReport).

If this is not what you needed, please provide more information.
Last Answered: Nov 26 2008  8:01 PM GMT by Carlosdl   29830 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0