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 / Modules / DAO / VBA / December 2006

Tip: Looking for answers? Try searching our database.

unbound combo box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DucateAssignment - 15 Dec 2006 01:13 GMT
I have a form (InmateSelect) where I am trying to use an unbound combo box
(cboInmateSelect) to select records from a table named Downinfo.  The unbound
combo box will display three fields from this table named CDCnum, InmateName,
and InmateHousing.  When I select a CDCnum, the data, which is text, is
displayed, in the combo box however I get an error

Run-time error ‘3070’:
The Microsoft Jet Database engine does not recognize ‘F26776’ (which is the
data I selected) as a valid field or expression.  

I also have 3 bound text boxes that I want the data selected to be displayed.
At this point none of the data is displayed in the text boxes.  This is the
code I am using and  the database is designed to edit/update the table and
query the information.

Private Sub cboInmate_Select_AfterUpdate()

   Dim rst As DAO.Recordset
   Set rst = Me.RecordsetClone
   rst.FindFirst "[CDCnum] = " & Me.cboInmate_Select
   If Not rst.NoMatch Then
       Me.Bookmark = rst.Bookmark
   End If
   Set rst = Nothing
End Sub

Can anyone help me with this?

Thanks
Ducat assignment
Allen Browne - 15 Dec 2006 01:37 GMT
The example data (F26776) suggests this is a Text field, not a Number field.

If it is a Text field, the value need to be in quotes, i.e.:
   rst.FindFirst "[CDCnum] = """ & Me.cboInmate_Select & """"

If those quotes don't make sense, see:
   Quotation marks within quotes
at:
   http://allenbrowne.com/casu-17.html

Note that cboInmate must be an *unbound* control (so it doesn't try to save
this value). It may also be a good idea to explictly save the current record
before trying to find another one:
   If Me.Dirty Then Me.Dirty = False

Signature

Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a form (InmateSelect) where I am trying to use an unbound combo box
> (cboInmateSelect) to select records from a table named Downinfo.  The
[quoted text clipped - 31 lines]
> Thanks
> Ducat assignment
DucateAssignment - 15 Dec 2006 22:44 GMT
Allen

I've played around with this issue for about a week and you tell me to use
quotation marks and this works.  I've looked in three different books and
still had no idea.  I thank you very much.

DucatAssignment

>The example data (F26776) suggests this is a Text field, not a Number field.
>
[quoted text clipped - 16 lines]
>> Thanks
>> Ducat assignment
 
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.