A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

can't get combo boxes to work



 
 
Thread Tools Display Modes
  #1  
Old June 24th, 2004, 05:09 PM
maura
external usenet poster
 
Posts: n/a
Default 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  
Old June 24th, 2004, 05:35 PM
tina
external usenet poster
 
Posts: n/a
Default 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  
Old June 24th, 2004, 05:51 PM
external usenet poster
 
Posts: n/a
Default 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  
Old June 25th, 2004, 07:12 AM
tina
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 09:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.