none
Visual Basic LISTVIEW ADD

    Question

  • Hello All,
    Excuse me for I only have about three (3) months experience with VB and Visual Studio Prof 2012.  I am attempting to do something and I have attempted many ways but nothing is working.  I hope I am using the correct terms.

    My first dialog is a COMBOBOX and the property name if COMBOBOX1.
    When the fist selectedindex 0 is selected a listview form is called.  The listview form is named BUDGET in the property screen
    and the listview is named listview1 in the property screen.  The listview has only one column (this is only a test to see if this work and to learn). When the add button is click a new form by the name of ADD_ENTRY is displayed.
    The column name on the ADD_ENTRY properity is named TEXTBOX_DESC.  The following code is excuted and the value of DESC is correct (I used the trace debug feature of VS to see the value).
    After the code excute the listview entry does not appear on the listview.  WHY?  Am I going about this all wrong? What approach should I be taking?  I do not know how to use exception or whatever it is called to see if there is an error.   Code follows:

    Private Sub BTN_OK_Click(sender As Object, e As EventArgs) Handles BTN_OK.Click
            DDESC = Me.TextBox_DESC.Text  ' <== DESC have the correct value at this point

            Dim LVI2ITEM As ListViewItem = BUDGET.ListView1.Items.Add(DDESC, 0)

    Please help.  Point me in the right direction.

    Ed.


    ecb

    Sunday, January 06, 2013 7:14 PM

Answers

  • You have created a new listview item, but you haven't done anything with it.  For this new listview item to appear in the listview it needs to be added to the items collection of the listview.

    http://msdn.microsoft.com/en-us/library/3a7fwahe(v=vs.100).aspx

    In your case, it would be something like this:

      Listview1.Items.Add(LVI2ITEM)

    Sunday, January 06, 2013 9:01 PM
  •    It appears there are different ways one can add an entry.  I basically need code that will add an entry when I am in the form that is displayed for the user to enter the data, NOT the form that the listview is displayed in.

    Then your problem is not in adding an item to a listview - it is accessing a control that is on another form.  The simplest way to do this properly is to have a variable that refers to that other form - then you can use that variable to refer to any control on the form, somewhat like you were doing with

        budget.listview1.items.add(lvi2item)

    If you create that variable correctly you can use it like you used budget above.  For instance:

    (at the form level)
        Dim myBudgetForm as Budget

    (when you open the budget form)
        myBudgetForm = New Budget
        myBudgetForm.Show

    (when you want to access the control)
        myBudgetForm.listview1.items.add(lvi2item)

    See: http://vbdotnetblog.wordpress.com/forms/

    Monday, January 07, 2013 6:53 AM
  • I've more times written that you go in a direction which leads to that you simply stop in some months. 

    However, before you think that I cannot make it what you say, this code, be aware for those who see this, only usable for learning purposes. In practise it has effects which you don't like.

    Public Class Form1
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ComboBox1.Items.AddRange({"This", "is", "not", "the", "best", "way", "to", "use", "this"})
            ComboBox1.SelectedIndex = -0
            AddHandler ComboBox1.SelectedIndexChanged, AddressOf ComboBox1_SelectedIndexChanged
        End Sub
        Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs)
    
            Using Form2 As New Form2
                Form2.ListViewItemToAdd = New ListViewItem
                Form2.ListViewItemToAdd.Text = CStr(ComboBox1.SelectedItem)
                Form2.ShowDialog()
            End Using
        End Sub
    End Class


    Public Class Form2
        Friend Property ListViewItemToAdd As ListViewItem
        Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            ListView1.Items.Add(ListViewItemToAdd)
        End Sub
    End Class

    Result


    Success
    Cor

    Monday, January 07, 2013 9:27 AM
  • From the listview the user select an option to ADD an entry.  This third screen allow the user to enter the data that is to be added.  This last screen is the screen that I wish to use the LISTVIEW1.ITEMS.ADD(LISTVIEWITEMTOADD).   This is where I can not seams to get the code to add the entry to the LISTVIEW screen.  

    You are referring to controls (listview, combobox) as if they were forms, which is very confusing.  I think you mean that you have a form with a combobox, a form with a listview, and a form where the user enters some text.  It seems you are trying to update a control in a form (the listview form) with data entered in a form that is opened from the listview form (the text entry form).   In other words, you want to pass some information from one form back to the form that opened it.

    To do this you  should use a dialog form.  The dialog form will include the field(s) needed for getting the user input.  It will make this data available to the calling form which will create the listview line and update the listview.

    Do Project / Add Windows Form and select Dialog.  Give it a name or accept the default of Dialog1.   Add a text box to the form. Add this code to the form:

        Public ReadOnly Property Desc() As String
            Get
                Return TextBox1.Text
            End Get
        End Property

    In the form that it going to display this dialog (the listview form), when the user selects Add, use this code:

            Dim dlg As New Dialog1
            dlg.ShowDialog()
            If dlg.DialogResult <> Windows.Forms.DialogResult.Cancel Then
                Dim LVI2Item As New ListViewItem(dlg.Desc)
                ListView1.Items.Add(LVI2Item)
            End If

    Change Dialog1 if you named the dialog differently.  The feature of a dialog form that you are using to do this is that the form is not disposed when the user closes it, so you can query a property of that form (the textbox text value) after the dialog is closed in order to find out what the user entered in the textbox, and update your listview accordingly.

    Monday, January 07, 2013 11:27 AM
  • There are endless ones on Internet, also on our website (also endless ones)

    You can use a DataGridView as UI for a database, for a datatable or direct from Data. 

    The most easies to show is to start with a datatable from an XML string

    http://www.vb-tips.com/XMLToDataSet.ASPX

    Be aware I took the most simple one and see how quick this goes. 

    Just try it in a separate project.

    However, you can also use a datagridview with not any table, with a Class, or whatever data you want.,

    Also you can include for instance comboboxes

    http://www.vb-tips.com/DataGridViewCombo.aspx

    And many many more.


    Success
    Cor

    Monday, January 07, 2013 4:18 PM
  • Ed,

    I would encourage you to edit your message and remove your e-mail address.

    *****

    Even though this will seem pointless, I'd like to get you to do something. It won't take but a few minutes and I'm hopeful that it will be an "ahHA!" moment.

    Start a new project. By default it will create Form1.vb for you. Now add a second form and leave it as its default name "Form2.vb".

    On Form1, just put a single button it and leave the name as "Button1":

    On Form2, place a single label and leave it to its default name also:

    Now for the code for each, replace all of yours with the following:

    Form1.vb

    Option Strict On Option Explicit On ' Public Class Form1 ' Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click ' Using f2 As New Form2 f2.labelText = "Some Text" f2.ShowDialog() End Using End Sub End Class

    Form2

    Option Strict On Option Explicit On ' Public Class Form2 ' Public labelText As String = "" ' Private Sub Form2_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles MyBase.Load ' Label1.Text = labelText End Sub End Class

    Run it and you'll see that we only used Form2.vb as a template; it didn't exist until you specifically instantiated it - ergo, created a NEW instance of it - from Form1. Once you did that, you could then send the text to show to the public variable called "labelText" in Form2.

    Let me know if it works and if it makes sense why it did. :)


    Please call me Frank :)

    Monday, January 07, 2013 9:11 PM

All replies

  • Hello Ed,

     I see you rant about a combobox for a brief moment, but I see not where it is relevant. It seems like you just want to know how to add something to a listview.

    You're question is somewhat confusting, if this does not answer it, can you simplify your question?


    If all you want to do is add a listview item, then the method is easy.

    Option Strict On
    Public Class Form1
        Friend WithEvents ListView1 As ListView
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ListView1 = New ListView With {.Dock = DockStyle.Fill, .Parent = Me}
            ListView1.View = View.Details
            ListView1.Columns.Add("Hello")
            ListView1.Items.Add(New ListViewItem("World"))
        End Sub
    End Class

    More Elaboration

    Option Strict On
    Public Class Form1
        Friend WithEvents ListView1 As ListView
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ListView1 = New ListView With {.Dock = DockStyle.Fill, .Parent = Me}
            ListView1.View = View.Details
            ListView1.Columns.Add("Hello")
            ListView1.Columns.Add("World")
            Dim Item As New ListViewItem("Items(0).Text - Or - Items(0).SubItem(0).Text")
            Item.SubItems.Add("Items(0).SubItem(1).Text")
            ListView1.Items.Add(Item)
            MsgBox(ListView1.Items(0).Text)
            MsgBox(ListView1.Items(0).SubItems(0).Text)
            MsgBox(ListView1.Items(0).SubItems(1).Text)
        End Sub
    End Class
    


    If you want something you've never had, you need to do something you've never done.

    Everyone should take the time to mark helpful posts and propose answers!

    Answer an interesting question?
    Create a wiki article about it!

    My Technet Wiki Articles


    Sunday, January 06, 2013 8:15 PM
    Moderator
  • You have created a new listview item, but you haven't done anything with it.  For this new listview item to appear in the listview it needs to be added to the items collection of the listview.

    http://msdn.microsoft.com/en-us/library/3a7fwahe(v=vs.100).aspx

    In your case, it would be something like this:

      Listview1.Items.Add(LVI2ITEM)

    Sunday, January 06, 2013 9:01 PM
  • Acamar, When I code listview1.listviewitems.add(lvi2item)  I get error:  listview1 is not declared.  it may be inaccessible due to its protection level.  When I code budget.listview1.listviewitems.add(lvi2item) I get error: listviewitems is not a member of 'system.windows.forms.listview1'

    What am I not understanding.

    Ed.


    ecb

    Sunday, January 06, 2013 9:44 PM
  • Acamar, When I code listview1.listviewitems.add(lvi2item)  I get error:  listview1 is not declared.  it may be inaccessible due to its protection level.  When I code budget.listview1.listviewitems.add(lvi2item) I get error: listviewitems is not a member of 'system.windows.forms.listview1'

    What am I not understanding.

    Ed.


    ecb

    listviewitems does not exist.

    it should be 

    ListView1.Items.Add(Item)


    If you want something you've never had, you need to do something you've never done.

    Everyone should take the time to mark helpful posts and propose answers!

    Answer an interesting question?
    Create a wiki article about it!

    My Technet Wiki Articles

    Sunday, January 06, 2013 9:46 PM
    Moderator
  • There's a typo in that code which I thought I corrected.  Use your second example (I assume that the listview is on a different form than the button click where this code is executing) and do

      budget.Listview1.Items.Add(LVI2ITEM)

    I have adjusted the original.

    Sunday, January 06, 2013 9:57 PM
  • Ed,

    I'm sure that you're more than frustrated - I can see why. I know you've been working with ListViews and various forms for weeks now.

    I'd like to make a suggestion: Instead of talking in "code talk", from start to finish explain what your ultimate goal for this project is and let one of us write a program that will accomplish that then hand it back to you so that you can examine it.

    Obviously if it's some HUGE project with overwhelming tasks that's not likely to happen! ;-)

    But it's a thought. I may not be the one who hands you back a good working version but I will if I can (time-permitting, and that's not always the case).

    What do you think about that notion?


    Please call me Frank :)

    Sunday, January 06, 2013 10:31 PM
  • Frank, You are correct I have been attempting to learn VB and I am now attempting to add an item in a listview when I am NOT in the same form that the listview is in.  When I am in the same form as the listview it work but when I am in the next form that I enter the text no matter what I try it is not working.   I have used all the tips that was given but they do not work.   It appears there are different ways one can add an entry.  I basically need code that will add an entry when I am in the form that is displayed for the user to enter the data, NOT the form that the listview is displayed in.   I have attempted everything I can think of and all tips that was given.

    For some reason when I create a project and the FIRST form is the LISTVIEW I can add an entry, but when I create a project when my first form is a combobox that send me to a listview and then I attempt to add an entry nothing seams to work.  I am sure the combobox have nothing to do with my problem and I am simply not understanding some basic things.  Any help would be appreciated.  Thanks for all your help in the past.

    Ed.


    ecb

    Monday, January 07, 2013 5:09 AM
  • Frank, You are correct I have been attempting to learn VB and I am now attempting to add an item in a listview when I am NOT in the same form that the listview is in.  When I am in the same form as the listview it work but when I am in the next form that I enter the text no matter what I try it is not working.  

    Ed.

    No there are different ways how to use forms, it need very very much knowledge of .Net to create a program with more than 1 non dialog or mdi form. 


    Success
    Cor

    Monday, January 07, 2013 6:19 AM
  • Cor, I suspected as such and that is the reason I stated that when  my project start with the listview it work, but when the project start with a combobox and then went to a listview it does not work.  I use each tip that was given to me but done work.  I can not find any documentation that will show me how to do it from start to finish.  They are all in pieces and I can not put them together.

    Ed.


    ecb

    Monday, January 07, 2013 6:31 AM
  • Hello Ed,

    If you are trying to add an item to a listview that is located on another form, there are a couple things you need to ensure.

    1.) The listview is declared public or friend

    2.) the form that the listview is located on has currently been loaded(shown).

    3.) You can no longer simply access the listview like this:

    ListView1.Items.Add

    You now would have to access it like this:

    Form2.ListView1.Items.Add(Replace Form2 with whatever the name of the form containing the listview you want to access)

    I hope you find this useful.


    If you want something you've never had, you need to do something you've never done.

    Everyone should take the time to mark helpful posts and propose answers!

    Answer an interesting question?
    Create a wiki article about it!

    My Technet Wiki Articles




    Monday, January 07, 2013 6:43 AM
    Moderator
  •    It appears there are different ways one can add an entry.  I basically need code that will add an entry when I am in the form that is displayed for the user to enter the data, NOT the form that the listview is displayed in.

    Then your problem is not in adding an item to a listview - it is accessing a control that is on another form.  The simplest way to do this properly is to have a variable that refers to that other form - then you can use that variable to refer to any control on the form, somewhat like you were doing with

        budget.listview1.items.add(lvi2item)

    If you create that variable correctly you can use it like you used budget above.  For instance:

    (at the form level)
        Dim myBudgetForm as Budget

    (when you open the budget form)
        myBudgetForm = New Budget
        myBudgetForm.Show

    (when you want to access the control)
        myBudgetForm.listview1.items.add(lvi2item)

    See: http://vbdotnetblog.wordpress.com/forms/

    Monday, January 07, 2013 6:53 AM
  • I've more times written that you go in a direction which leads to that you simply stop in some months. 

    However, before you think that I cannot make it what you say, this code, be aware for those who see this, only usable for learning purposes. In practise it has effects which you don't like.

    Public Class Form1
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ComboBox1.Items.AddRange({"This", "is", "not", "the", "best", "way", "to", "use", "this"})
            ComboBox1.SelectedIndex = -0
            AddHandler ComboBox1.SelectedIndexChanged, AddressOf ComboBox1_SelectedIndexChanged
        End Sub
        Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs)
    
            Using Form2 As New Form2
                Form2.ListViewItemToAdd = New ListViewItem
                Form2.ListViewItemToAdd.Text = CStr(ComboBox1.SelectedItem)
                Form2.ShowDialog()
            End Using
        End Sub
    End Class


    Public Class Form2
        Friend Property ListViewItemToAdd As ListViewItem
        Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            ListView1.Items.Add(ListViewItemToAdd)
        End Sub
    End Class

    Result


    Success
    Cor

    Monday, January 07, 2013 9:27 AM
  • Cor, I guess I do not know enough to ask the right questions.  I am using Visual Studio Prof 2012 to create a COMBOBOX.  From the combobox when the user select a options to go to a LISTVIEW.  From the listview the user select an option to ADD an entry.  This third screen allow the user to enter the data that is to be added.  This last screen is the screen that I wish to use the LISTVIEW1.ITEMS.ADD(LISTVIEWITEMTOADD).   This is where I can not seams to get the code to add the entry to the LISTVIEW screen.  

    I can create a project where is LISTVIEW is the first screen and I can make the add work.  But when I go from a COMBOBOX to a LISTVIEW to a TEXTBOX is where it does not work.  In your example I see you go from a combobox to a listview, but I do not see the screen that the user will add the data.   I have review many, many, many links looking for an example with no luck.  If this is not the best way as you as stated what is the best way?  I there a link that will show me the BEST WAY?

    Ed.


    ecb

    Monday, January 07, 2013 10:48 AM
  • From the listview the user select an option to ADD an entry.  This third screen allow the user to enter the data that is to be added.  This last screen is the screen that I wish to use the LISTVIEW1.ITEMS.ADD(LISTVIEWITEMTOADD).   This is where I can not seams to get the code to add the entry to the LISTVIEW screen.  

    You are referring to controls (listview, combobox) as if they were forms, which is very confusing.  I think you mean that you have a form with a combobox, a form with a listview, and a form where the user enters some text.  It seems you are trying to update a control in a form (the listview form) with data entered in a form that is opened from the listview form (the text entry form).   In other words, you want to pass some information from one form back to the form that opened it.

    To do this you  should use a dialog form.  The dialog form will include the field(s) needed for getting the user input.  It will make this data available to the calling form which will create the listview line and update the listview.

    Do Project / Add Windows Form and select Dialog.  Give it a name or accept the default of Dialog1.   Add a text box to the form. Add this code to the form:

        Public ReadOnly Property Desc() As String
            Get
                Return TextBox1.Text
            End Get
        End Property

    In the form that it going to display this dialog (the listview form), when the user selects Add, use this code:

            Dim dlg As New Dialog1
            dlg.ShowDialog()
            If dlg.DialogResult <> Windows.Forms.DialogResult.Cancel Then
                Dim LVI2Item As New ListViewItem(dlg.Desc)
                ListView1.Items.Add(LVI2Item)
            End If

    Change Dialog1 if you named the dialog differently.  The feature of a dialog form that you are using to do this is that the form is not disposed when the user closes it, so you can query a property of that form (the textbox text value) after the dialog is closed in order to find out what the user entered in the textbox, and update your listview accordingly.

    Monday, January 07, 2013 11:27 AM
  • Cor, I guess I do not know enough to ask the right questions.  I am using Visual Studio Prof 2012 to create a COMBOBOX.  From the combobox when the user select a options to go to a LISTVIEW.  From the listview the user select an option to ADD an entry.  This third screen allow the user to enter the data that is to be added.  This last screen is the screen that I wish to use the LISTVIEW1.ITEMS.ADD(LISTVIEWITEMTOADD).   This is where I can not seams to get the code to add the entry to the LISTVIEW screen.  

    I can create a project where is LISTVIEW is the first screen and I can make the add work.  But when I go from a COMBOBOX to a LISTVIEW to a TEXTBOX is where it does not work.  In your example I see you go from a combobox to a listview, but I do not see the screen that the user will add the data.   I have review many, many, many links looking for an example with no luck.  If this is not the best way as you as stated what is the best way?  I there a link that will show me the BEST WAY?

    Ed.


    ecb

    I've already endless times written to you that the listview is not a good control for what you want to do and to use the DataGridView instead of that.


    Success
    Cor

    Monday, January 07, 2013 1:31 PM
  • Frank, You are correct I have been attempting to learn VB and I am now attempting to add an item in a listview when I am NOT in the same form that the listview is in.  When I am in the same form as the listview it work but when I am in the next form that I enter the text no matter what I try it is not working.   I have used all the tips that was given but they do not work.   It appears there are different ways one can add an entry.  I basically need code that will add an entry when I am in the form that is displayed for the user to enter the data, NOT the form that the listview is displayed in.   I have attempted everything I can think of and all tips that was given.

    For some reason when I create a project and the FIRST form is the LISTVIEW I can add an entry, but when I create a project when my first form is a combobox that send me to a listview and then I attempt to add an entry nothing seams to work.  I am sure the combobox have nothing to do with my problem and I am simply not understanding some basic things.  Any help would be appreciated.  Thanks for all your help in the past.

    Ed.


    ecb

    Ed,

    I have to take off for a meeting soon and in all liklihood I won't be back "online" until tomorrow.

    Think about something though. You can't send the elements of a ListView to a form which doesn't yet exist. Assuming that you will instantiate that form when you're ready to show it, what you want to do is to prepare what to send to it as a parameter (think about a list of some sort here), then use it as a parameter.

    Instantiate the new form, "send" it the parameter (that list), then display it.

    Make sense?


    Please call me Frank :)

    Monday, January 07, 2013 1:50 PM
  • OK Cor, Please lead me to a link that will show me how to us a DataGridView instead of a listview that will display the entries so the customer can see all the columns.  I will follow your instruction.

    Frank, regarding sending the elements of a listview to a form that doesn't yet exist,  the listview is displayed AFTER the combobox and BEFORE the textbox that the use will add the data is displayed.    In this order (1) COMBOBOX, (2) LISTVIEW, (3) TEXTBOX that will be used to enter the data than same (4) LISTVIEW that will be displayed again to show the new entry.

    Ed.


    ecb

    Monday, January 07, 2013 3:10 PM
  • There are endless ones on Internet, also on our website (also endless ones)

    You can use a DataGridView as UI for a database, for a datatable or direct from Data. 

    The most easies to show is to start with a datatable from an XML string

    http://www.vb-tips.com/XMLToDataSet.ASPX

    Be aware I took the most simple one and see how quick this goes. 

    Just try it in a separate project.

    However, you can also use a datagridview with not any table, with a Class, or whatever data you want.,

    Also you can include for instance comboboxes

    http://www.vb-tips.com/DataGridViewCombo.aspx

    And many many more.


    Success
    Cor

    Monday, January 07, 2013 4:18 PM
  • Ed,

    I would encourage you to edit your message and remove your e-mail address.

    *****

    Even though this will seem pointless, I'd like to get you to do something. It won't take but a few minutes and I'm hopeful that it will be an "ahHA!" moment.

    Start a new project. By default it will create Form1.vb for you. Now add a second form and leave it as its default name "Form2.vb".

    On Form1, just put a single button it and leave the name as "Button1":

    On Form2, place a single label and leave it to its default name also:

    Now for the code for each, replace all of yours with the following:

    Form1.vb

    Option Strict On Option Explicit On ' Public Class Form1 ' Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click ' Using f2 As New Form2 f2.labelText = "Some Text" f2.ShowDialog() End Using End Sub End Class

    Form2

    Option Strict On Option Explicit On ' Public Class Form2 ' Public labelText As String = "" ' Private Sub Form2_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles MyBase.Load ' Label1.Text = labelText End Sub End Class

    Run it and you'll see that we only used Form2.vb as a template; it didn't exist until you specifically instantiated it - ergo, created a NEW instance of it - from Form1. Once you did that, you could then send the text to show to the public variable called "labelText" in Form2.

    Let me know if it works and if it makes sense why it did. :)


    Please call me Frank :)

    Monday, January 07, 2013 9:11 PM
  • Frank, just minutes ago I used the technique you showed me on the modify code that you sent several days ago.  The one when you used the "WITH MODIFY" and I passed the variables back and did the add in the listview form and everything work.

    I will following your instruction to learn the process on what you just sent.  Also, I did not know that I could edit the stuff that I had already sent but I will see if I can delete my email address.

    I would like to thank everyone for all the effort that your spent on a NEW BEE that ask many silly questions.  Thanks again to everyone.  Thanks, Thanks.

    Ed.


    ecb

    Tuesday, January 08, 2013 12:35 AM
  • Frank, I edited and toke out my email address but when I look again it was still in.  How do I save.

    ecb

    Tuesday, January 08, 2013 12:41 AM
  • Frank,  OK I ran the test that you sent and it work.  I receive the message on the screen.  But I still do not know how this would have help because the LISTVIEW that I wanted to add an entry to was already displayed with many entries.   As I stated earlier, my add is working once I used the technique that you showed me with your modify code using the 'WITH MODIFY'.   This was a learning curve because I attempted every way but quit.  Thanks again for all your effort in getting me my this problem.  I still do not know how to edit my earlier message and save the update.

    Ed.


    ecb

    Tuesday, January 08, 2013 1:08 AM
  • I'm confused by this entire thread (I'm easily confused though). Ed wouldn't it be simpler if you just posted the code for COMBOBOX, BUDGET and ADD_ENTRY. And above that explain what you want to be able to do with each Form?


    You've taught me everything I know but not everything you know.

    Tuesday, January 08, 2013 2:07 AM
  • Mr. MonkeyBoy, you are correct.  Looking back, it would have been the way to go.  I am new at this VB and I guess I just did not look at it the right way.   Thanks for everyone help with this problem.

    Ed.


    ecb

    Tuesday, January 08, 2013 2:53 AM
  • Frank,  OK I ran the test that you sent and it work.  I receive the message on the screen.  But I still do not know how this would have help because the LISTVIEW that I wanted to add an entry to was already displayed with many entries.   As I stated earlier, my add is working once I used the technique that you showed me with your modify code using the 'WITH MODIFY'.   This was a learning curve because I attempted every way but quit.  Thanks again for all your effort in getting me my this problem.  I still do not know how to edit my earlier message and save the update.

    Ed.


    ecb

    About the message with your e-mail address, I don't know - they keep changing this forum around. If nothing else, try to delete the message entirely.

    I'm sorry that I don't understand what you're trying to do then. You already have passed the data over and it's showing in the other form (shown modally I presume?). So ... what are you trying to do in this run of it?


    Please call me Frank :)

    Tuesday, January 08, 2013 2:04 PM
  • Frank, I have resolved the problem by using the example you gave me several days ago.  I use the WITH parameter that you showed me with the modify code.  Now when I display the combobox then the listview than the textbox (that the user use add the entry) than back to the listview and my added entry is on the listview list.  Everything is working OK, thanks to all of your help and others.

    Ed.


    ecb

    Tuesday, January 08, 2013 7:51 PM
  • ...Everything is working OK, thanks to all of your help and others.

    Ed.


    ecb

    Ed,

    When using these forums, please close your threads once your question has been answered.  To do so, click the "Mark As Answer" link on the post or posts that ultimately answer the question. 

    Thanks!


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Tuesday, January 08, 2013 8:39 PM
    Moderator
  • Frank, I have resolved the problem by using the example you gave me several days ago.  I use the WITH parameter that you showed me with the modify code.  Now when I display the combobox then the listview than the textbox (that the user use add the entry) than back to the listview and my added entry is on the listview list.  Everything is working OK, thanks to all of your help and others.

    Ed.


    ecb

    I'm glad you have it all working.


    Please call me Frank :)

    Tuesday, January 08, 2013 9:45 PM