Results 1 to 3 of 3

Thread: Dynamic Reporting / Database Structure HELP.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    124

    Question Dynamic Reporting / Database Structure HELP.

    Hi guys, I need an input on how to structure my database so that i can come up with a dynamic reporting.

    My GUI is like this compose of labels and many checkboxes.

    Code:
                          A    B    C    D    E    F    G
    Category1
      Sub Category1A      *    *    *    *    *    *    *
      Sub Category1B      *    *    *    *    *    *    *
      Sub Category1C      *    *    *    *    *    *    *
      Sub Category1D      *    *    *    *    *    *    *
    Category2
      Sub Category2A      *    *    *    *    *    *    *
      Sub Category2B      *    *    *    *    *    *    *
    Category3
      Sub Category3A      *    *    *    *    *    *    *
      Sub Category3B      *    *    *    *    *    *    *
      Sub Category3C      *    *    *    *    *    *    *
    Those asterisk represent checkboxes. So the user can select 1 or more. The bold asterisk for example are checked or checked = 1. The ABCDEFG are categories as well. Now it's like they are crossing each other I'm confused on how to structure my database.

    What i want to achieve is a report type like this in listview or any reporting control.

    Code:
    A
      Category2 - Sub Category2A
      Category3 - Sub Category3A
    B
      Category1 - Sub Category1A, Sub Category1B
      Category3 - Sub Category3A
    C
      Category3 - Sub Category3C
    D
      Category1 - Sub Category1D
    E
      None
    F
      None
    G
      Category2 - Sub Category2A, Sub Category2B

    The report is dynamic. If both sub categories fell on the the same it will put (,) comma.

    Please help me guys. My checkbox are control array. The fields on my database are only the subcategories.

    Here is what i started. I use this function to insert 1,0 values on the database. I don't know if it's right. it will put 0000000, if there is no check values. it will put 1111111 if all are checked.

    Code:
    Private Function ReadChkBoxes(ByVal lngStart As Long, ByVal lngEnd As Long) As String
    Dim z As Long
    Dim pattern As String
    
    For z = lngStart To lngEnd
        If Check1(z).Value = 1 Then
            pattern = pattern & "1"
        Else
            pattern = pattern & "0"
        End If
    Next z
    
    SC = pattern
    
    End Function
    I'm on dead end please help me. The dynamic reporting is a pain.

  2. #2
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Dynamic Reporting / Database Structure HELP.

    So your database field values are bit 1 and 0s? Why don't you add values to it or put the strings on another table on the database, put a delimiter like | then parse it. Put the values on an array and populate it in the listview.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    124

    Re: Dynamic Reporting / Database Structure HELP.

    thanks for the reply but i don't really understand your suggestion.

    Anyway, can somebody give me a link on how to work with checkboxes in VB and database access. Especially those with cross-category checkboxes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width