vb.net with access - multi same form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • needanswer
    New Member
    • Mar 2010
    • 3

    vb.net with access - multi same form

    Can I save values from the multi same form? How?

    Sample:

    on this form - one datagridview, one textbox, one combobox.

    Thanks.
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Hello needanswer,

    I am guessing that everyone is having a hard time understanding your question because there have been 73 views and no responses. I am going to try to provide an answer to what I believe you’re asking. If I am way off please post a reply and add more detail to your question in what you’re trying to do.

    I think you’re asking if you can save values from multiple controls within a form on a post back. An example would be:

    Code:
    <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="TextBox1" runat="server" />
            <asp:DropDownList ID="DropDownList1" runat="server">
                <asp:ListItem Text="First Option" Value="1" />
                <asp:ListItem Text="Second Option" Value="2" />
            </asp:DropDownList>
            <asp:Button ID="Button1" runat="server" Text="Submit" />
        </div>
    </form>

    If I am correct in what you’re asking for help with then using the above example you could do something like this:

    Code:
        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim TextBoxValueToSave As String = TextBox1.Text
            Dim DropDownListValueToSave As String = DropDownList1.SelectedItem.Value
        End Sub
    Here you can see that two controls within a form are save within variables that can be used how ever you with to use them.

    Hope this helps,
    CroCrew~

    Comment

    • CroCrew
      Recognized Expert Contributor
      • Jan 2008
      • 564

      #3
      Hello needanswer,

      It is against forum rules to post a Visitor Message or PM to a moderator or expert directly about technical questions for a number of reasons but mainly because the moderator or expert might not know how to help you.

      Also by receiving help on the forums the whole world can see how you've solved your problem and this could help others facing the same issues; whereas receiving help through PM's or Visitor Messages keeps this information private/hidden from the public eye.

      Please review the posting guidelines especially the section on Do not PM Experts, Moderators or Administrators about questions for more information as to why this is unacceptable.

      I'll be happy to help you in the thread that you have started regarding your problem.


      CroCrew~

      Originally posted by needanswer
      Again, thanks your reply.
      Your answer is very close my question, but if this form with a datagridview, we cannot save the datagridview values with form?

      I think, multi same form with vb.net is not the purpose to save the values with form.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Is this an ASP.NET application or a Windows Desktop application?
        When you are referring to a "form", are you talking about a Windows Form, and Access Form, or a Web Form?

        Comment

        Working...