Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Easiest way to hide a VB form?

  • 04-12-2007 3:55pm
    #1
    Closed Accounts Posts: 5,240 ✭✭✭


    Looking for a quick simple solution to hide a form. I am swapping between two forms but they are just being generated on top of each other. The .hide method does not seem to work with forms.

    Cheers


Comments

  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    setVisible false


  • Closed Accounts Posts: 5,240 ✭✭✭Endurance Man


    Ahh, i don't see setVisible anywhere? Would it be: form1.setVisible(false)?


  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    Sorry, form1.Visible = false;


  • Closed Accounts Posts: 5,240 ✭✭✭Endurance Man


    Cheers giblet, that worked.

    Maybe you can give me a hand with my next problem :o.
    I have a form setup with 4 text boxes (txtName,txtEmail,txtExam,txtPercent). I have then connected to a very simple database which has a table which has properties for each of my text boxes. I have bound each text box to its appropriate property in the database as well. I then have a save button, when i click this i want the data i have entered to be saved to the dataset and then applied to the database.
    Im just not sure of the code behind my save button :(.

    Also im guessing the save function should be enclosed in a try/catch block?

    Any help much appreciated.


  • Closed Accounts Posts: 5,240 ✭✭✭Endurance Man


    snip


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    Are you using SQL?

    It would be an insert statement using the values of your textboxes.

    Insert into tablename values(txtName,txtEmail,txtExam,txtPercent);

    Or whatever you have.

    Unless you mean you have the database table mapped to an object?


  • Closed Accounts Posts: 5,240 ✭✭✭Endurance Man


    No, im just using a DataAdapter and DataSet to extract the data. I then have each text box bound to the appropriate property.
    I tried this with no luck:

    OleDbDataAdapter1.Fill(AllData1)
    BindingContext(AllData1, "tblStudents").AddNew()
    txtForename.DataBindings.Add("Text", AllData1, "tblStudents.studentForeName")
    AllData1.AcceptChanges()
    OleDbDataAdapter1.Update(AllData1.Tables("tblStudents"))

    I'm probably way off, the notes iv been given are so badly written, cant make out half of it :(.
    I'm very new to VB so sorry if this doesn't make any sense :o, more of a java man.


Advertisement