Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

run-time error 3077 no apostrophes!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
moorsey - 28 Mar 2007 10:14 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.