Vb6 Database to populate textbox in sequence

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wernerh
    New Member
    • Jul 2007
    • 104

    #1

    Vb6 Database to populate textbox in sequence

    Hi all,

    A little problem someone can help me with. Got Access db connected through Adodc connection populating datagrid etc. What I am trying to achieve is for the database records which are each unique to populate a specific text box. I have no problem populating a set of textboxes relating to one recordset, but to do multiple is proving a headache. To explain better: I am doing a budget.

    Database has following fields
    Field 1 in db Cost Dept
    Field 2 in db Month 1
    Field 3 in db month 2
    etc.
    etc.

    So data in each record has cost dept and 12 months budget entries.
    Next line in db has next cost dept and it's 12 monh budget. Just like a spreadsheet in excel basically.

    The problem is I want to show the database records in seperate textboxes at the same time. On a form you will have say 5 text boxes for cost dept and each will show it's 12 months of budgets in 12 textboxes listed in a row. first set is record 1 in database second set is record 2 in database. It is haveing the second set of textboxes to read record 2 and third set to read record 3 etc etc I have a problem with. If someone could please tell me how to do this i would appreciate it.

    Thank you
  • Wernerh
    New Member
    • Jul 2007
    • 104

    #2
    Originally posted by Wernerh
    Hi all,

    A little problem someone can help me with. Got Access db connected through Adodc connection populating datagrid etc. What I am trying to achieve is for the database records which are each unique to populate a specific text box. I have no problem populating a set of textboxes relating to one recordset, but to do multiple is proving a headache. To explain better: I am doing a budget.

    Database has following fields
    Field 1 in db Cost Dept
    Field 2 in db Month 1
    Field 3 in db month 2
    etc.
    etc.

    So data in each record has cost dept and 12 months budget entries.
    Next line in db has next cost dept and it's 12 monh budget. Just like a spreadsheet in excel basically.

    The problem is I want to show the database records in seperate textboxes at the same time. On a form you will have say 5 text boxes for cost dept and each will show it's 12 months of budgets in 12 textboxes listed in a row. first set is record 1 in database second set is record 2 in database. It is haveing the second set of textboxes to read record 2 and third set to read record 3 etc etc I have a problem with. If someone could please tell me how to do this i would appreciate it.

    Thank you
    Does not seem like anyone wants to help me with this or it is not possible.

    Here iis my code that i have got for reading the record.

    Adodc1.Connecti onString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" + App.Path + "\data\adodb1.m db"
    Adodc1.RecordSo urce = "SELECT * FROM budget"
    Adodc1.Refresh

    Text98.Text = Adodc1.Recordse t.Fields(1)
    Text99.Text = Adodc1.Recordse t.Fields(2)

    This works great for the first record in the db, but would like to have Text99.text read the second record.

    The only thought that comes to mind is something like this:
    Text99.Text = Adodc1.Recordse t.Row (2).Fields(1).. .......trying to identify the record nr in the database, but obviously it does not work.

    Anyone with a solution?

    Comment

    Working...