PleaseGiveHelp
Programmer
I need to create a data report in VB. I'm new at this and not quite sure where to start. Do I need to create a data environment? And how do I specify the datasource and datamembers? If I am using a SQL query, do I need to specify the fields? As of now, my code is all within the code section of the data report and I"m not sure this is right. This is what I have:
Private Sub DataReport_Initialize()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "blahblahblah;"
Set mpreport = rptmemoreport
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select blah blah blah", db, adOpenStatic, adLockOptimistic
Set mpreport.DataSource = adoPrimaryRS
'mpreport.PrintForm
'mbDataChanged = False
'adoPrimaryRS.Close
'Set adoPrimaryRS = Nothing
'Unload rptmemoreport
End Sub
However when I try to then create the report, I can't figure out how to set up the fields to look at the data...its just empty. Help!
Private Sub DataReport_Initialize()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "blahblahblah;"
Set mpreport = rptmemoreport
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select blah blah blah", db, adOpenStatic, adLockOptimistic
Set mpreport.DataSource = adoPrimaryRS
'mpreport.PrintForm
'mbDataChanged = False
'adoPrimaryRS.Close
'Set adoPrimaryRS = Nothing
'Unload rptmemoreport
End Sub
However when I try to then create the report, I can't figure out how to set up the fields to look at the data...its just empty. Help!