Results 1 to 11 of 11

Thread: [RESOLVED] Connect database field to database field

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    9

    Resolved [RESOLVED] Connect database field to database field

    Hi guys and girls, in first place sorry for my english.

    I really need help, I created a local Database in VB2008 with 4 tables, the problem is that I have a textbox in one table and a combobox in other table and I want that the information that I put in textbox appear after in combobox from the other table... that's possible?

    Table: Filmes ... Field: NomeTextBox
    Table: Tempo de Aluguer ... Field: Nome_FilmeComboBox

  2. #2
    Fanatic Member
    Join Date
    Nov 2010
    Posts
    965

    Re: Connect database field to database field

    I dont understand on your question. do you want to say that when you add some entry in textbox on one form so that you want to display that entry in combobox?

  3. #3
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Connect database field to database field

    Welcome!

    Perhaps if you gave us the table structure we could figure it out. Normally textboxes and comboboxes don't go in tables.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    9

    Re: Connect database field to database field

    I have 2 different tables in 2 different forms and I want that when I put a string in textbox and save that string appear on combobox list from the other form...

  5. #5
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Connect database field to database field

    You can create a method on the form with the combobox to add an item to it.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    9

    Re: Connect database field to database field

    Quote Originally Posted by MarMan View Post
    You can create a method on the form with the combobox to add an item to it.
    And how I do that ?

  7. #7
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Connect database field to database field

    Create a public sub.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  8. #8

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    9

    Re: Connect database field to database field

    Quote Originally Posted by MarMan View Post
    Create a public sub.
    And I can do that with a field from database?

  9. #9
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    307

    Re: Connect database field to database field

    This would add the text from a Textbox on one form to the list of items in a combobox on another. Is that what you're trying to do?

    Code:
    ComboBox1.Items.Add(Form1.TextBox1.Text)

  10. #10

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    9

    Re: Connect database field to database field

    Quote Originally Posted by dkahn View Post
    This would add the text from a Textbox on one form to the list of items in a combobox on another. Is that what you're trying to do?

    Code:
    ComboBox1.Items.Add(Form1.TextBox1.Text)
    I think that is something like that but didn't work because combobox and textbox are both fields from a localdatabase.

    Already I solved the problem ... I used the option "Use data bound items" and solved

    Thanks for your help.
    Last edited by RuNaWaY; Feb 17th, 2011 at 05:59 AM.

  11. #11
    Fanatic Member
    Join Date
    Nov 2010
    Posts
    965

    Re: Connect database field to database field

    Quote Originally Posted by RuNaWaY View Post
    I have 2 different tables in 2 different forms and I want that when I put a string in textbox and save that string appear on combobox list from the other form...
    call the database at the form load event on that form where you want to see the data and bind the specific field with combobox

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