0

Good day!

Is there a way to make the data report to show only the fields selected by the user?
I have a form where the user can select the fields(from ms access table) in the list box(checkbox enabled) to show in data report. The total fields is almost 50. When the user check/selects only 10 fields, then that will be the fieds to show in the data report. I need any idea to make it like this dynamically.

Thank you!

2
Contributors
1
Reply
10
Views
2 Years
Discussion Span
Last Post by Shark_1
0

Create the SQL Statement by concatinate the field names, which theuser selected.

        Dim xStr As String = "Select "
        For i As Integer = 0 To ListBox1.SelectedItems.Count - 1
            xStr &= ListBox1.SelectedItems(i)
            If i < ListBox1.SelectedItems.Count - 1 Then
                xStr &= ", "
            End If
        Next
        xStr &= " From Table1"

Suppose, it can help you.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.