jesus_hairdo
Registered User.
- Local time
- Today, 13:36
- Joined
- Sep 28, 2001
- Messages
- 32
i have a form with 2 combo boxes in. combo68 is a category chooser, and combo70 holds the a value from that category. (eg combo68= odd number, combo70=3)
What i want to do is to have combo70 dynamically change the choices depending on the category chosen in combo68.
i can get this to work for a new record by doing an afterupdate on combo70. This works great.
Now i am trying to get it to display the correct values for an existing record, i have tried using an if statement like the code below.
This works except that i want it to just display some text if combo68 if empty, at the moment this just displays an empty combo box.
Any ideas where i am going wrong ??
thanks
Jamie
------------------------
Private Sub Form_Current()
Dim category As String
category = Me.Combo68.DefaultValue
If IsNull(category) Then
Me.Combo70.RowSourceType = "Value List"
Me.Combo70.RowSource = "Select Category first"
Else
Me.Combo70.RowSourceType = "Table/Query"
Me.Combo70.RowSource = "SELECT [tbl_category_complaint_type].[complaint_type] FROM [tbl_category_complaint_type] where [tbl_category_complaint_type].[category] = '" & Me.Combo68.Value & "';"
End If
End Sub
What i want to do is to have combo70 dynamically change the choices depending on the category chosen in combo68.
i can get this to work for a new record by doing an afterupdate on combo70. This works great.
Now i am trying to get it to display the correct values for an existing record, i have tried using an if statement like the code below.
This works except that i want it to just display some text if combo68 if empty, at the moment this just displays an empty combo box.
Any ideas where i am going wrong ??
thanks
Jamie
------------------------
Private Sub Form_Current()
Dim category As String
category = Me.Combo68.DefaultValue
If IsNull(category) Then
Me.Combo70.RowSourceType = "Value List"
Me.Combo70.RowSource = "Select Category first"
Else
Me.Combo70.RowSourceType = "Table/Query"
Me.Combo70.RowSource = "SELECT [tbl_category_complaint_type].[complaint_type] FROM [tbl_category_complaint_type] where [tbl_category_complaint_type].[category] = '" & Me.Combo68.Value & "';"
End If
End Sub