Recalling Records from a Combo search

Dreamcatcher

Registered User.
Local time
Today, 09:02
Joined
Jul 15, 2008
Messages
19
Hi

I have a table 'tblRecords' and i'm trying to search against a field numeric field called BoxNumber and display findings onto a form.

Basically, a 'Search - By Box Number' button on the switchboard opens 'frmSearch_BoxNumber' which contains just a combo of BoxNumber. When operator chooses number the records are displayed in the subreport 'SfrmSearch_BoxNumber' below.

I have the following code in the AfterUpdate of the combo
Private Sub Combo28_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Record Number] = " & Str(Nz(Me![Combo28], 0))
' MsgBox [Combo28]
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Problem i'm getting is that not all the records are being retrived??
I.e Box 100 there are 3 records but only 1 is showing.
Box 13 there is 1 record but none is showing.

Not an expert on coding etc, so would appreciate any help please.

John
 

Attachments

i would take a different approach.

Base your form on a query instead of on a table. Then in the field which you are performing the search on put the reference to the combo in the criteria row in your query i.e. Forms!FormName!ComboName

Then in the after update event of your combo simply put Me.Requery
 

Users who are viewing this thread

Back
Top Bottom