My Assistant
![]() ![]() |
|
|
Sep 22 2007, 01:25 PM
Post
#1
|
|
|
UtterAccess Enthusiast Posts: 69 From: Chicago, IL |
Alright, I've got a nice cascading combo box going on except one thing.
I keep getting a type mismatch error. Private Sub unit_AfterUpdate() On Error Resume Next Me.unit_num = Me.unit.Column(0) cti_ewo_num.RowSource = "Select tbl_ewo_numbers.ewo_num " & _ "FROM tbl_ewo_numbers " & _ "WHERE tbl_ewo_numbers.project_num = '" & unit_num.Value & "' " & _ "ORDER BY tbl_ewo_numbers.id;" End Sub everything is fine except in the 'me.unit_num...' statement it's storing the numbers as text in the query that is built just below. I need a number stored in unit_num not a string. It tried solving the problem by switching tbl_ewo_numbers.project_num to a text field, but when I go to store a value in the combo box, there is another type mismatch to the field that the cti_ewo_num is bound to. Suggestions? |
|
|
|
Sep 22 2007, 01:34 PM
Post
#2
|
|
|
UtterAccess Enthusiast Posts: 69 From: Chicago, IL |
I even tried this and got the same results. It stores '3' in the query instead of just 3.
Private Sub unit_AfterUpdate() Dim unit_des as Integer On Error Resume Next unit_des = Me.unit.Column(0) cti_ewo_num.RowSource = "Select tbl_ewo_numbers.ewo_num " & _ "FROM tbl_ewo_numbers " & _ "WHERE tbl_ewo_numbers.project_num = '" & unit_des & "' " & _ "ORDER BY tbl_ewo_numbers.id;" End Sub |
|
|
|
Sep 22 2007, 02:01 PM
Post
#3
|
|
|
UtterAccess Enthusiast Posts: 69 From: Chicago, IL |
I fixed it.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 24th May 2013 - 05:50 PM |