Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataReport Loads before I could assign any value 1

Status
Not open for further replies.

tmarte

Programmer
Oct 22, 2001
8
US
'first load and clean report
Load deNalLeg
With deNalLeg
Set rptNalLeg.DataSource = Nothing
rptNalLeg.DataMember = ""
If .rsNal.State Then .rsNal.Close
...BEGIN COMMENT:command "NalLeg" get's loaded at this point, Before I could assign it the datasource I want! this means it tries to open the original "Data Source" which might not be the Data Source I want...END COMMENT
End With

deNalLeg.rsNal.Open mystring, cnmyApp, adOpenStatic, adLockOptimistic

'ASSIGN RS TO REPORT
Set rptNalLeg.DataSource = deNalLeg.rsNal
...
 
Dear tmarte,
i suppose rsNal is a variable dimensioned as recordset ?

could be that you just have to leave out the dots and compare the state not to be open .
(I am at home and cannot look up the constant need sorry, something like adstateclosed)
If not (rsNal.State = adstateclosed) Then rsNal.Close

HTH

regards Astrid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top