[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
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?
Re: Connect database field to database field
Welcome! :wave:
Perhaps if you gave us the table structure we could figure it out. Normally textboxes and comboboxes don't go in tables.
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...
Re: Connect database field to database field
You can create a method on the form with the combobox to add an item to it.
Re: Connect database field to database field
Quote:
Originally Posted by
MarMan
You can create a method on the form with the combobox to add an item to it.
And how I do that ?
Re: Connect database field to database field
Re: Connect database field to database field
Quote:
Originally Posted by
MarMan
Create a public sub.
And I can do that with a field from database?
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)
Re: Connect database field to database field
Quote:
Originally Posted by
dkahn
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.
Re: Connect database field to database field
Quote:
Originally Posted by
RuNaWaY
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