If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
can't get combo boxes to work
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 |
#2
|
|||
|
|||
can't get combo boxes to work
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? "maura" wrote in message ... 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 |
#3
|
|||
|
|||
can't get combo boxes to work
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]? 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? "maura" wrote in message ... 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 . |
#4
|
|||
|
|||
can't get combo boxes to work
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? wrote in message ... 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]? 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? "maura" wrote in message ... 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 . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
3 Linked Combo Boxes | Jason Wills | Using Forms | 4 | June 9th, 2004 04:12 PM |
Combo Boxes #2 | Tom | Using Forms | 0 | June 9th, 2004 03:51 AM |
Combo Boxes #1 | Tom | Using Forms | 0 | June 9th, 2004 03:50 AM |
Combo Box Problem | Charles | Using Forms | 0 | May 28th, 2004 09:15 PM |