Re: non-firing Form_Current on new record selected by listbox
- From: "Dirk Goldgar" <dg@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 5 Apr 2009 21:43:15 -0400
"BBC via AccessMonster.com" <u49322@uwe> wrote in message news:942c2de60af79@xxxxxx
Access 2007 I am selecting records on a form via a listbox. The
Form_Current event fires on opening the form (1st record is selected by
default) and fires on the selection of all records selected via the ListBox
EXCEPT when re-selecting the very first record again (after going to another
record). It DOESN'T fire only when using the the ListBox, using my
navigation buttons always causes the Form_Current to fire on moving to
another record (even going back to the first record).
The ListbBox always selects & diplays the correct record, 1st or otherwise
The code for the ListBox is (using After_Update event)
DoCmd.SearchForRecord , "", acFirst, "[ClientID] = " & Str(Nz(Screen.
ActiveControl, 0))
Typical record navigation code is
DoCmd.GoToRecord , "", acNext
any thoughts or suggestions
I don;t know why that would be, and don't have my A2007 PC turned on at the moment, but you might check if different code for your list-box navigation makes a difference. For example, I would code it this way:
'----- start of example code -----
Private Sub lstYourListbox_AfterUpdate()
With Me.lstYourListbox
If Not IsNull(.Value) Then
Me.Recordset.FindFirst "ClientID=" & .Value
End If
End With
End Sub
'----- end of example code -----
If that code works and doesn't show the misbehavior you report, I would conclude it's some quirk of DoCmd.SearchForRecord, though I haven't heard of that before.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
.
- Follow-Ups:
- Re: non-firing Form_Current on new record selected by listbox
- From: BBC via AccessMonster.com
- Re: non-firing Form_Current on new record selected by listbox
- References:
- non-firing Form_Current on new record selected by listbox
- From: BBC via AccessMonster.com
- non-firing Form_Current on new record selected by listbox
- Prev by Date: Re: LOGMARS & PDF417 Barcodes
- Next by Date: RE: Movement through a form with Tab and Enter key movements
- Previous by thread: non-firing Form_Current on new record selected by listbox
- Next by thread: Re: non-firing Form_Current on new record selected by listbox
- Index(es):
Relevant Pages
|