M
moorsey
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
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