I have a main form, from which I open a another form, frmSchedule
frmSchedule has a datagrid, which is bound to an ado data control
The data control is based on a table called TempSchedule. Before I open frmSchedule, I delete the contents of TempSchedule and replace with a fresh schedule.
However, gridSchedule will be blank. Now if I use a message box after frmSchedule opens, gridSchedule will be filled after I click ok.
I tried datSchedule.Refresh but that did nothing either. At the moment my code is
VB Code:
stSQL = "DELETE * FROM TempSchedule" cnnAsset.Execute stSQL stSQL = "INSERT INTO TempSchedule SELECT Schedule.* From Schedule " & _ "WHERE Schedule.Sch_AssetCode = '" & stAssetCode & "'" cnnAsset.Execute stSQL, lAffected frmSchedule.lTotalSchedules = lAffected
Then in the frmSchedule Load event
VB Code:
' Now wait until the schedule data loads While lCountSchedules < lTotalSchedules lCountSchedules = Me.datSchedule.Recordset.RecordCount Me.datSchedule.Refresh Wend
Surely theres a better way!?
