Hi,
I'm hoping that someone can point me in the right direction, I've searched online and cant seem to find the solution to my problem. I think its because i'm searching for the wrong thing.
I have a combo box (Cmb_Price_Matrix) on my form that has two options, depending on what's has been selected in this combo box it instructs another combo box (Cmb_Height) to display results from different tables.
as shown below
I Wish to group the Height value field in the second combo box but cant figure out where to put the GROUP BY part in the code.
my current results show:
1000
1000
1000
1000
1001
1001
1001
1002
1002
1002
and I want it to show:
1000
1001
1002
I can do this in a normal query but trying to do it from VBA code is something that's out of my depth.
Hope the above makes sense and someone can shed some light on this.
Thank you
I'm hoping that someone can point me in the right direction, I've searched online and cant seem to find the solution to my problem. I think its because i'm searching for the wrong thing.
I have a combo box (Cmb_Price_Matrix) on my form that has two options, depending on what's has been selected in this combo box it instructs another combo box (Cmb_Height) to display results from different tables.
as shown below
Code:
Dim sPriceMatrixSource As String
If Me.Cmb_Price_Matrix.Value = "Price Matrix 1" Then
sPriceMatrixSource = "SELECT [Tbl_Price_Matrix_1].[HeightValue], FROM Tbl_Price_Matrix_1"
Me.Cmb_Height.RowSource = sPriceMatrixSource
Me.Cmb_Height.Requery
Else
sPriceMatrixSource = "SELECT [Tbl_Price_Matrix_2].[HeightValue] FROM Tbl_Price_Matrix_2"
Me.Cmb_Height.RowSource = sPriceMatrixSource
Me.Cmb_Height.Requery
End If
I Wish to group the Height value field in the second combo box but cant figure out where to put the GROUP BY part in the code.
my current results show:
1000
1000
1000
1000
1001
1001
1001
1002
1002
1002
and I want it to show:
1000
1001
1002
I can do this in a normal query but trying to do it from VBA code is something that's out of my depth.
Hope the above makes sense and someone can shed some light on this.
Thank you