datagrids

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    datagrids

    i have made an access database but i want to use the information in the database in an visual basic form the form i have made has a datagrid on it but i don't know how to enter the information in the datagrid. i have surfed the web to find out how to do this but i really don't understand it. the database im using is access 2000 and the visual basic is the vb6 if you could help me understand how this is done i would be very greatfull to who ever helps me. in the database i have a orders table i would like the datagrid to show the customers account number and orderdate and duedate

    thanx lee123
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    #2
    Originally posted by lee123
    i have made an access database but i want to use the information in the database in an visual basic form the form i have made has a datagrid on it but i don't know how to enter the information in the datagrid. i have surfed the web to find out how to do this but i really don't understand it. the database im using is access 2000 and the visual basic is the vb6 if you could help me understand how this is done i would be very greatfull to who ever helps me. in the database i have a orders table i would like the datagrid to show the customers account number and orderdate and duedate

    thanx lee123
    What type of control you are using
    ADO RDO or simple DATA control

    ALI

    Comment

    • lee123
      Contributor
      • Feb 2007
      • 556

      #3
      its a ado control the data1control doesn't seem to work

      lee123

      Comment

      • Ali Rizwan
        Banned
        Contributor
        • Aug 2007
        • 931

        #4
        Originally posted by lee123
        its a ado control the data1control doesn't seem to work

        lee123
        Ok
        Set DataSource Property to the name of your ADO name.
        Suppose you want to link you DGrid to ADODC1 then Set DataSource property to ADODC1.
        And if you are using DataEnvironment then Set DataSource property to DataEnvironment name and DataMember to to the Commad.

        run the programe and you ll see your all data will managed in the DGrid.

        GOODLUCK
        ALI

        -------------------------

        Comment

        • lee123
          Contributor
          • Feb 2007
          • 556

          #5
          Hey thank you Ali, it worked. but one question? can you put more than on datagrid on a form? if so is the steps the same? if not what do i need to do?

          Lee123

          Comment

          • Ali Rizwan
            Banned
            Contributor
            • Aug 2007
            • 931

            #6
            Originally posted by lee123
            Hey thank you Ali, it worked. but one question? can you put more than on datagrid on a form? if so is the steps the same? if not what do i need to do?

            Lee123
            Hi,
            Yeah you can add infinite Grids on your form.And the steps are same.
            GOODLUCK
            ALI

            Comment

            • lee123
              Contributor
              • Feb 2007
              • 556

              #7
              Now that i have two datagrids i have to different table information showing one is the order table and the other is the customer table (off of the access database) my question is how do i link the information to the right customer.so when i scroll to the next customer the datagrid should also change shouldn't it? i don't know this is way different that access.

              p.s
              both of the tables (access) have ID's linked to one another in access.

              lee123

              Comment

              • Ali Rizwan
                Banned
                Contributor
                • Aug 2007
                • 931

                #8
                Originally posted by lee123
                Now that i have two datagrids i have to different table information showing one is the order table and the other is the customer table (off of the access database) my question is how do i link the information to the right customer.so when i scroll to the next customer the datagrid should also change shouldn't it? i don't know this is way different that access.

                p.s
                both of the tables (access) have ID's linked to one another in access.

                lee123
                Ok
                Have you used seperate database for every customer order or you have manuplate the order into a single database?
                GOODLUCK
                ALI

                Comment

                • Ali Rizwan
                  Banned
                  Contributor
                  • Aug 2007
                  • 931

                  #9
                  Originally posted by lee123
                  Now that i have two datagrids i have to different table information showing one is the order table and the other is the customer table (off of the access database) my question is how do i link the information to the right customer.so when i scroll to the next customer the datagrid should also change shouldn't it? i don't know this is way different that access.

                  p.s
                  both of the tables (access) have ID's linked to one another in access.

                  lee123
                  Hi,
                  The way i m using to make a link b/w teachers name and thier monthly attendance in my database i have a seperate database for every teacher.

                  I have done suchthing.
                  At the back i have named the databases by teachers seril no or customer serial no.whenever the serial changes the database with named the serial number opened and shown in the grid.
                  You can say
                  If the serial no of customer is 1 then database no 1 opened to ADODC2
                  when 2 database no 2 opened to ADODC2
                  and so on.
                  **************
                  And the next type you have only one database
                  then its very easy use this code to choose the order associated with customer.

                  with respect to name

                  Code:
                  Dim cs As String
                  cs = txtCustomerName 'Must be from customer info database
                  
                      ADODC2.Refresh
                      ADODC2.Recordset.Find "Name='" & cs & "'"
                  With respect to Serial No

                  Code:
                  ADODC2.Refresh
                  ADODC2.Recordset.Find "Sr = " &  txtSR ' Must be from customer info
                  GOOD LUCK
                  ALI

                  Comment

                  Working...