searching through access records

dabwang
12-19-2003, 07:42 AM
can anyone suggest a way to let a user search through records in a database.

i have it working so that the first record appears and the user can move forwards and back but what i want to do is to allow the user to select, from a list, which record to view and then by clicking on the list, the record appears.

the list is also working fine

is there no way to say something like

While Not table.EOF

If form1.list1.text = table!TopicID Then

show the record

Else

table.MoveNext
End If
Wend

End Sub

i have something like this in my code but it doesnt work


any ideas

thanks

nige

Shurik12
12-19-2003, 07:49 AM
Hi,

You could have a look at the .Filter property of the recordset object (eventually .Find) For more details search the "Database and Reporting" forum.

Regards,
Shurik.

stallyonuk
12-19-2003, 07:57 AM
Hi,

You could have a look at the .Filter property of the recordset object (eventually .Find) For more details search the "Database and Reporting" forum.

Regards,
Shurik.

The solution is a simple one and one that I have adopted in many areas.

I have a list box called "cboLast5MembersVisited" and the following code placed in the OnChange event. Incidentally the combo box cboLast5MembersVisited shows a list of the last 5 account numbers a user visited by date descending order.

Private Sub cboLast5MembersVisited_Change()
If Not IsNull(Me.cboLast5MembersVisited) Then
Me.AccountNo.SetFocus
DoCmd.FindRecord Me.cboLast5MembersVisited
End If
End Sub

Hope this helps

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum