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 / Database Design / June 2004

Tip: Looking for answers? Try searching our database.

can't get combo boxes to work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
maura - 24 Jun 2004 17:09 GMT
Can't seem to get either of these combo boxes to work.
Both are on the same form and I have been playing around
with them, but can seem to get them to pull up the right
record, or I get a runtime error '3464' Data Type Mismatch
in Criteria Expression. But I don't understand what is
mismatched. Can you help. Thanks.

Private Sub Combo57_AfterUpdate()
   ' Find the record that matches the control.
   Dim rs As Object

   Set rs = Me.Recordset.Clone
   rs.FindFirst "[TransStock]= '" & Me![Combo57] & "'"
   If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub Combo59_AfterUpdate()
   ' Find the record that matches the control.
   Dim rs As Object

   Set rs = Me.Recordset.Clone
   rs.FindFirst "[TransReference] = " & Str(Nz(Me!
[Combo59], 0))
   If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
tina - 24 Jun 2004 17:35 GMT
what is the data type of field [TransStock]?
what is the data type of the *bound* column of Combo57?
what is the data type of field [TransReference]?
what is the data type of the *bound* column of Combo59?

> Can't seem to get either of these combo boxes to work.
> Both are on the same form and I have been playing around
[quoted text clipped - 21 lines]
>     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
> End Sub
- 24 Jun 2004 17:51 GMT
In looking at this I think I want the combo box to bring
up the main field which is:

TransID

Both combo boxes are unbound. Data type for TransStock and
TransReference are both text. TransID is an autonumber and
when I try this in the code I get the run time error 3079
Specific field 'TransID' could refer to more than one
table listed in teh FROM clause of your SQL statment... so
I tried putting tblTransports.TransID, I get a run time
error 3345 Unknown or invalid field
reference '[tblTransports.TransID]'.

>-----Original Message-----
>what is the data type of field [TransStock]?
[quoted text clipped - 29 lines]
>
>.
tina - 25 Jun 2004 07:12 GMT
an unbound combo box does not have a ControlSource in the form's underlying
table or query. but it always has a BoundColumn. that's the column that is
referenced from the RowSource table, query or SQL statement. and the field
that populates the bound column has a data type.
since you're getting a Type Mismatch error, the first thing to check is the
data types in the FindFirst line of code, for each combo box.
so i need to know, what is the data type of the bound column of each combo
box?
> In looking at this I think I want the combo box to bring
> up the main field which is:
[quoted text clipped - 47 lines]
> >
> >.
 
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.