kiss.shoremishra
Registered User.
- Local time
- Today, 06:42
- Joined
- Feb 4, 2017
- Messages
- 19
Hi All,
I am working on large set of Cascading combos on form. I initially got Data type mismatch error and I corrected the query as the last combo has data type number & not text but now and I am again getting prompt to enter the value for variable instead of retrieving it from above Combo. Below is my code.
Private Sub Combo19_AfterUpdate()
Dim pdtgrp5 As String
If Me.Combo19.Value <> "" Then
pdtgrp5 = Me.Combo19.Value
P5 = "SELECT DISTINCT [Tbl - WRIN].[Item Prefix] FROM [Tbl - WRIN] WHERE ([Tbl - WRIN].[Product Group Level5]) = '" & pdtgrp5 & "' ORDER BY [Tbl - WRIN].[Item Prefix];"
Me.Combo21.RowSource = P5
End If
Me.Combo21 = vbNullString 'to clear the next combo
Me.Combo21.Requery
End Sub
Private Sub Combo21_AfterUpdate()
Dim ItmPfix As Integer
If Me.Combo21.Value <> "" Then
ItmPfix = Me.Combo21.Value
IP = "SELECT DISTINCT [Tbl - WRIN].[Prefix Description] FROM [Tbl - WRIN] WHERE ([Tbl - WRIN].[Item Prefix]) = ItmPfix ORDER BY [Tbl - WRIN].[Prefix Description];"
Me.Combo23.RowSource = IP
End If
Me.Combo23 = vbNullValue 'to clear the next combo
Me.Combo23.Requery
End Sub
I am working on large set of Cascading combos on form. I initially got Data type mismatch error and I corrected the query as the last combo has data type number & not text but now and I am again getting prompt to enter the value for variable instead of retrieving it from above Combo. Below is my code.
Private Sub Combo19_AfterUpdate()
Dim pdtgrp5 As String
If Me.Combo19.Value <> "" Then
pdtgrp5 = Me.Combo19.Value
P5 = "SELECT DISTINCT [Tbl - WRIN].[Item Prefix] FROM [Tbl - WRIN] WHERE ([Tbl - WRIN].[Product Group Level5]) = '" & pdtgrp5 & "' ORDER BY [Tbl - WRIN].[Item Prefix];"
Me.Combo21.RowSource = P5
End If
Me.Combo21 = vbNullString 'to clear the next combo
Me.Combo21.Requery
End Sub
Private Sub Combo21_AfterUpdate()
Dim ItmPfix As Integer
If Me.Combo21.Value <> "" Then
ItmPfix = Me.Combo21.Value
IP = "SELECT DISTINCT [Tbl - WRIN].[Prefix Description] FROM [Tbl - WRIN] WHERE ([Tbl - WRIN].[Item Prefix]) = ItmPfix ORDER BY [Tbl - WRIN].[Prefix Description];"
Me.Combo23.RowSource = IP
End If
Me.Combo23 = vbNullValue 'to clear the next combo
Me.Combo23.Requery
End Sub