Hello all,
I have a problem with my forms OnCurrent event. It does not fire when I move to the first record. The problem lies with the AfterUpdate event for a listbox that is on the form.
This problem have been argued on several forums, but i have not found an answer on how to go around this bug.
Easy explanation:
FrmA contains a listbox and several bound controls. The bound controls are textboxes and checkboxes.
On frmA there is some code in the OnCurrent event of the form. The codes are mainly simple and short if statements:
If me.checkboxA = true then
Me.txtboxA.visible= true
else
Me.txtboxA.visible=false
end if
And so on.
To navigate the records on the form I use a listbox. In the AfterUpdate event I have the following code:
DoCmd.SearchForRecord , "", acFirst, "[ID] = " & Str(Nz(Screen.ActiveControl, 0))
The problem is that the forms OnCurrent events works fine when navigating all records in the listbox EXCEPT for the first record. For example if you go from record X to record 1, the OnCurrent event does NOT fire, but if you go from record X to record 2,3 or anyone else above the first, it works fine.
I need help rewriting the listbox AfterUpdate event so that the forms OnCurrent event fires when moving from record X to the first record.
I use Access 2010.
I have a problem with my forms OnCurrent event. It does not fire when I move to the first record. The problem lies with the AfterUpdate event for a listbox that is on the form.
This problem have been argued on several forums, but i have not found an answer on how to go around this bug.
Easy explanation:
FrmA contains a listbox and several bound controls. The bound controls are textboxes and checkboxes.
On frmA there is some code in the OnCurrent event of the form. The codes are mainly simple and short if statements:
If me.checkboxA = true then
Me.txtboxA.visible= true
else
Me.txtboxA.visible=false
end if
And so on.
To navigate the records on the form I use a listbox. In the AfterUpdate event I have the following code:
DoCmd.SearchForRecord , "", acFirst, "[ID] = " & Str(Nz(Screen.ActiveControl, 0))
The problem is that the forms OnCurrent events works fine when navigating all records in the listbox EXCEPT for the first record. For example if you go from record X to record 1, the OnCurrent event does NOT fire, but if you go from record X to record 2,3 or anyone else above the first, it works fine.
I need help rewriting the listbox AfterUpdate event so that the forms OnCurrent event fires when moving from record X to the first record.
I use Access 2010.