Click here to Skip to main content
16,005,120 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Code to close all child form Pin
Mekong River27-Oct-06 18:00
Mekong River27-Oct-06 18:00 
QuestionAccessing ports of a DVR card Pin
W.A. Dilhara24-Oct-06 18:31
W.A. Dilhara24-Oct-06 18:31 
AnswerRe: Accessing ports of a DVR card Pin
Dave Kreskowiak25-Oct-06 3:23
mveDave Kreskowiak25-Oct-06 3:23 
QuestionCombo Properties & Events Help Please Pin
cgai24-Oct-06 10:14
cgai24-Oct-06 10:14 
AnswerRe: Combo Properties & Events Help Please Pin
Dave Kreskowiak25-Oct-06 3:27
mveDave Kreskowiak25-Oct-06 3:27 
GeneralRe: Combo Properties & Events Help Please Pin
cgai25-Oct-06 5:11
cgai25-Oct-06 5:11 
GeneralRe: Combo Properties & Events Help Please Pin
Dave Kreskowiak25-Oct-06 5:30
mveDave Kreskowiak25-Oct-06 5:30 
GeneralRe: Combo Properties & Events Help Please Pin
cgai25-Oct-06 6:36
cgai25-Oct-06 6:36 
Dave Kreskowiak wrote:
I can't figure out what your ComboBox scenario is!!

Let's see... Are you saying that you have a ComboBox bound to a table that has a list of Names in it? The user picks a Name, then another ComboBox is supposed to fill with some other information, based on the Name picked??


I'll try my best to outline the scenario:

I am updating a strContactName field (using a ComboBox cboName) in a tblCompany record. There is also a strCity field in the record which filters the list of possible names. There is a dt_tblContactNames DataTable in a dsLookups DataSet.

dt_tblContactNames Fill: "SELECT strContactName FROM tblContactNames WHERE strCity = (my city in this record)" (this is used for the ContactName dropdown list, and it works fine)

When the user clicks the Save button on the Form, the changes are written to the database via a stored procedure, for which I define and pass field values as parameters, in VB code. This technique works fine for all the other fields.

Some issues:

1. After the City and Name are entered, the Name needs to display in the ComboBox text whenever the record is retrieved. It seems like the dropdown list needs to be properly filled, otherwise the Name does not display.

2. I need to bind the cboName control to strContactName ... probably using .SelectedValue, but I don't see why .Text does not work as well ..

3. I need to know when to fill the dropdown list for the ComboBox. Yes, after the City changes, but also when the form is first displayed ...

I have set most of wiring in the Properties window for the ComboBox, but I Call the Fill for the dropdown, and the record Update, in VB code.

I hope that helps explain what I am trying to do ... probably a common scenario.


cgai:
I am using VB.NET 2005 and WinForms. I have a bound (dropdownlist) ComboBox who's selection list is based on another field (City) on the Form. The Combo part is a 1-field query (strName) and I am storing the exact same strName field in the database. My selection list is working OK.



SteveH
Questionrefresh a form Pin
steve_rm24-Oct-06 7:22
steve_rm24-Oct-06 7:22 
AnswerRe: refresh a form Pin
Dave Kreskowiak24-Oct-06 7:45
mveDave Kreskowiak24-Oct-06 7:45 
QuestionRead an XML file as a datafile Pin
sybux200024-Oct-06 4:52
sybux200024-Oct-06 4:52 
AnswerRe: Read an XML file as a datafile Pin
Dave Kreskowiak24-Oct-06 5:04
mveDave Kreskowiak24-Oct-06 5:04 
GeneralRe: Read an XML file as a datafile Pin
sybux200025-Oct-06 21:03
sybux200025-Oct-06 21:03 
QuestionOne last hope Pin
Pete Newman24-Oct-06 4:09
Pete Newman24-Oct-06 4:09 
AnswerRe: One last hope Pin
nlarson1124-Oct-06 4:15
nlarson1124-Oct-06 4:15 
GeneralRe: One last hope Pin
Pete Newman24-Oct-06 4:23
Pete Newman24-Oct-06 4:23 
GeneralRe: One last hope Pin
Pete Newman24-Oct-06 4:25
Pete Newman24-Oct-06 4:25 
GeneralRe: One last hope Pin
Pete Newman24-Oct-06 4:44
Pete Newman24-Oct-06 4:44 
GeneralRe: One last hope [modified] Pin
nlarson1124-Oct-06 4:52
nlarson1124-Oct-06 4:52 
QuestionStatus Message Pin
jds120724-Oct-06 3:16
jds120724-Oct-06 3:16 
AnswerRe: Status Message Pin
nlarson1124-Oct-06 4:19
nlarson1124-Oct-06 4:19 
GeneralRe: Status Message Pin
jds120724-Oct-06 4:46
jds120724-Oct-06 4:46 
GeneralRe: Status Message Pin
Dave Kreskowiak24-Oct-06 4:55
mveDave Kreskowiak24-Oct-06 4:55 
GeneralRe: Status Message Pin
jds120724-Oct-06 5:21
jds120724-Oct-06 5:21 
GeneralRe: Status Message Pin
nlarson1124-Oct-06 4:55
nlarson1124-Oct-06 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.