Click here to Skip to main content
15,905,419 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Get Web Address Pin
Dave Kreskowiak25-Aug-08 12:36
mveDave Kreskowiak25-Aug-08 12:36 
QuestionLinkbutton not adding into table cell programmatically( problem ) Pin
Rameez Raja25-Aug-08 0:59
Rameez Raja25-Aug-08 0:59 
AnswerRe: Linkbutton not adding into table cell programmatically( problem ) Pin
jzonthemtn25-Aug-08 6:47
jzonthemtn25-Aug-08 6:47 
QuestionRead for database SQL 2005 with more than 20 columns in a record Pin
DCAUB25-Aug-08 0:44
DCAUB25-Aug-08 0:44 
AnswerRe: Read for database SQL 2005 with more than 20 columns in a record Pin
Colin Angus Mackay25-Aug-08 3:24
Colin Angus Mackay25-Aug-08 3:24 
GeneralRe: Read for database SQL 2005 with more than 20 columns in a record Pin
DCAUB25-Aug-08 3:35
DCAUB25-Aug-08 3:35 
GeneralRe: Read for database SQL 2005 with more than 20 columns in a record Pin
Colin Angus Mackay25-Aug-08 3:47
Colin Angus Mackay25-Aug-08 3:47 
QuestionHow to refresh a combobox in another form after the values of the combo have been updated? Pin
rprateek24-Aug-08 21:01
rprateek24-Aug-08 21:01 
I checked in msdn forum as well but there is one thread still pending not getting the answer of the similar problem, so I thought of posting it here.

Lets get the picture of the problem first.

1. I have a form called cat where I have one field called CatName where I save the data.

2 I have another form where I have got Combo box where I load cats when form loads.

Now question is imagine I have more than 40 fields in the form 2 where user filled up 39 fields but when he came to cats combo box then he found that one cat is not there so he opens cat form to add the new cat in it.
Then how can i acheive this without opening a new form.

Here is what i have tried so far

this is the sub where i load cats in combobox:
Public Sub LoadCats(ByVal cboCats As ComboBox)
Dim objdb As New clsObjDB
Dim ds As New DataSet
Dim str As String
cboCats.Items.Clear()
str = "Select * from cat order by catID desc"

ds = objdb.getDataset(str)

Dim dt As DataTable
dt = ds.Tables(0)
For Each row As DataRow In dt.Rows
cboCats.ValueMember = row("CatID")
cboCats.Items.Add(row("CatName"))
Next
End Sub

Now in cat I tried

Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
Dim objdb As New clsObjDB
Dim str As String

If txtCatName.Text.Trim = "" Then
MessageBox.Show("Enter the Cat Name")
txtCatName.Focus()
objdb = Nothing
Exit Sub
End If
str = "Insert into cat(CatName)values('" & txtCatName.Text & "')"
objdb.ExecuteQuery(str)
MessageBox.Show("Success")
'*****************************************
'Now my save is finished so over here i tried loading of cbocats
Dim frm As dog
'********* Here is the problem I can't do new here because the user wants to stay on the same page he was working on.

LoadCats(frm.cboCats)
Me.txtCatName.Text = ""
End Sub

Hope you guys get the point, I am very poor in explaining these sort of things....

Thanks in advance


AnswerRe: How to refresh a combobox in another form after the values of the combo have been updated? Pin
AlexeiXX325-Aug-08 6:10
AlexeiXX325-Aug-08 6:10 
GeneralRe: How to refresh a combobox in another form after the values of the combo have been updated? Pin
rprateek25-Aug-08 13:46
rprateek25-Aug-08 13:46 
AnswerRe: How to refresh a combobox in another form after the values of the combo have been updated? Pin
rprateek27-Aug-08 17:20
rprateek27-Aug-08 17:20 
QuestionMinimize all windows Pin
AlexeiXX324-Aug-08 18:29
AlexeiXX324-Aug-08 18:29 
AnswerRe: Minimize all windows Pin
John Ad24-Aug-08 21:33
John Ad24-Aug-08 21:33 
GeneralRe: Minimize all windows Pin
AlexeiXX325-Aug-08 6:03
AlexeiXX325-Aug-08 6:03 
GeneralRe: Minimize all windows Pin
Jon_Boy25-Aug-08 7:35
Jon_Boy25-Aug-08 7:35 
GeneralRe: Minimize all windows Pin
AlexeiXX325-Aug-08 7:40
AlexeiXX325-Aug-08 7:40 
GeneralRe: Minimize all windows Pin
JR21227-Aug-08 1:56
JR21227-Aug-08 1:56 
QuestionA more elegent way?? Pin
Rafone24-Aug-08 13:08
Rafone24-Aug-08 13:08 
AnswerRe: A more elegent way?? Pin
jzonthemtn24-Aug-08 13:36
jzonthemtn24-Aug-08 13:36 
GeneralRe: A more elegent way?? Pin
Rafone24-Aug-08 16:01
Rafone24-Aug-08 16:01 
AnswerRe: A more elegent way?? Pin
Gideon Engelberth25-Aug-08 2:45
Gideon Engelberth25-Aug-08 2:45 
QuestionDAtaBinding Problem Pin
vidhish24-Aug-08 1:35
vidhish24-Aug-08 1:35 
AnswerRe: DAtaBinding Problem Pin
Mycroft Holmes24-Aug-08 16:47
professionalMycroft Holmes24-Aug-08 16:47 
AnswerRe: DAtaBinding Problem Pin
rprateek24-Aug-08 21:18
rprateek24-Aug-08 21:18 
AnswerRe: DAtaBinding Problem Pin
Polymorpher27-Aug-08 14:27
Polymorpher27-Aug-08 14:27 

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.