traingamer
Programmer
I inherited a project with some odd behaviors.
I have a subform that has a listbox that chooses the active record on the subform. After deleting the active record (using a command button), delFlag is set to true, and there may or may not be a current record.
To choose a new current record, the doubleclick event on the list box does a FindFirst on (rs = Me.Recordset.Clone). This triggers the Form_Current event which HAD code like:
This would sometimes cause the entire application to just close with no warnings or messages at all.
I've replaced that with
and things seem to be working just fine. Can anybody tell me why this was the case? Is it because the RowSource was redefined and not requeried? There seems to be no reason to redefine the RowSource as it is already defined in the Form_Load.
Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
I have a subform that has a listbox that chooses the active record on the subform. After deleting the active record (using a command button), delFlag is set to true, and there may or may not be a current record.
To choose a new current record, the doubleclick event on the list box does a FindFirst on (rs = Me.Recordset.Clone). This triggers the Form_Current event which HAD code like:
Code:
Private Sub Form_Current()
If delFlag Then
delFlag = False
If bAnotherFlag = True Then
Me.lstDetails.RowSource = "SELECT (code removed)
Else
Me.lstDetails.RowSource = "SELECT (code removed)
End If
Else
Me.lstDetails.Requery
End If
end sub
I've replaced that with
Code:
Private Sub Form_Current()
delFlag = False
Me.lstDetails.Requery
end sub
Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill