FindFirst (1 Viewer)

Wallie

Registered User.
Local time
Today, 22:19
Joined
Mar 12, 2002
Messages
23
Hey,

I have a problem which I can't figure out....
I have a form where one can select a company and for that company the website is displayed with some extra info. The problem is, when there are no records in the table (websites) an error occurs:
No current record (3021). This is the code in the event for a combobox (AfterUpdate):
....
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[websiteID] = " & str(Me![companyComboBox])
Me.Bookmark = rs.Bookmark
websitesListBox.Requery
....

Any suggestions ?

Thanx
 

simongallop

Registered User.
Local time
Today, 22:19
Joined
Oct 17, 2000
Messages
611
Stick an If statement into the code after the findfirst so

rs.FindFirst ...
If rs.NoMatch = true then
Else
Me.Bookmark = rs.Bookmark
websitesListBox.Requery
End if

This will stop the box from requerying when null

HTH
 

Wallie

Registered User.
Local time
Today, 22:19
Joined
Mar 12, 2002
Messages
23
Thanx
 

Users who are viewing this thread

Top Bottom