OK, every post I've seen on this error has involved apostrophes, but mine
doesn't. I am using a combo box to look up members and the bound colum is an
autonumber field, so no special characters!
On de-bug I mouse over the cboFindmember in the code and it says
"cboFindmember = empty", even though a record was selected in the cbo box
code below is on the "search" button on my form which brings up a dlg box
for this search
thanks for any suggestions
Private Sub cmdFindmember_Click()
fconfirm = False
DoCmd.OpenForm "dlgfindmember", , , , , acHidden
Dim dlg As Form
Set dlg = Forms!dlgfindmember
dlg!cboFindmember = Null
dlg!cboFindmember.SetFocus
dlg.Visible = True
On Error GoTo searcherr
Do
DoEvents
Loop Until Not dlg.Visible
On Error GoTo 0
If Not fconfirm Then Exit Sub
Dim rst As Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "member_no = " & cboFindmember
If Not rst.NoMatch Then Me.Bookmark = rst.Bookmark
Exit Sub
searcherr:
If Err <> OBJECT_NO_LONGER_EXISTS Then
MsgBox Err & " " & Error
End If
End Sub
Brendan Reynolds - 29 Mar 2007 11:20 GMT
You forgot to put "dlg!" in front of cboFindmember in the following line ...
rst.FindFirst "member_no = " & cboFindmember
If you were using Option Explicit, you'd get an error message that the
variable cboFindmember was not defined, but because you are not using Option
Explicit, VBA will implicitly create a varaible of type Variant with that
name. A Variant to which no value has been assigned has the special value
Empty, which is what you're seeing when you mouse over the variable name in
break mode.

Signature
Brendan Reynolds
Access MVP
> OK, every post I've seen on this error has involved apostrophes, but mine
> doesn't. I am using a combo box to look up members and the bound colum is
[quoted text clipped - 40 lines]
> End If
> End Sub