Problems Refreshing fields after "No Entry Found"

G

Guest

Hi,

I've typed the following for a combox - AfterUpdate:

Dim db As Database
Dim rs As Recordset


Set db = CurrentDb
Set rs = Me.RecordsetClone
rs.FindFirst "[REVIEW_COURSE]= '" & Me![Combo47] & "' "
If rs.NoMatch Then
MsgBox "No Entry Found.", vbInformation
Else
Me.Bookmark = rs.Bookmark
End If

Me.Refresh

When I get the "No Entry Found" the records from the last search still
appear in the fields on my form. I'd like for the fields to be empty in
preparation for another search. How can I do that.

Also, When I select another name that is stored in '" & Me![Combo47] & "' "
the fields are still populated from the last search. Is there a way to clear
these fields or the bookmark?
 
A

Allen Browne

So you want to display the new record (where everything is blank) if there
was no match?

If rs.NoMatch Then
MsgBox "No Entry Found.", vbInformation
RunCommand acCmdRecordsGotoNew
Else ...

You probably want to clear the unbound combo as well:
Me.Combo47 = Null
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top