|
-
Apr 28th, 2011, 11:13 PM
#1
Thread Starter
Addicted Member
After click ok button all controls displaying data clear in dataentry form
Hi I am working VB.NET08.
After click the ok button all controls of displaying data should be clear in dataentry form.
If i enter some data in the Combobox or Textbox for saving the data into the database, If i click the OK button all controls of displaying data should be clear, B`se i want to enter next record, so how can i do this??
Is there any Refresh Property is there?
Thanks
-
Apr 28th, 2011, 11:24 PM
#2
Re: After click ok button all controls displaying data clear in dataentry form
You can set the value of all the controls to whatever their empty value is. Do you have a "Clear" button on the data-entry form as well? (This is a pretty common thing to have).
You can do it the very easy but tedious way of updating each control on its own line of code. You could alternatively do it the hard way of iterating over the collection of all controls and working out what property you should be setting and what value you should be setting it to. This means you don't have to keep updating your Clear method when you change the form.
I'd heartily recommend the first method, frankly.
-
Apr 28th, 2011, 11:30 PM
#3
Fanatic Member
Re: After click ok button all controls displaying data clear in dataentry form
 Originally Posted by malatesh kumar
Hi I am working VB.NET08.
After click the ok button all controls of displaying data should be clear in dataentry form.
If i enter some data in the Combobox or Textbox for saving the data into the database, If i click the OK button all controls of displaying data should be clear, B`se i want to enter next record, so how can i do this??
Is there any Refresh Property is there?
Thanks
hi malatesh, do you want that when you click the submit but or ok button to store the record into the database and all the controls on the form get clear? am i getting your right? do you really want this?
-
May 2nd, 2011, 10:03 PM
#4
Thread Starter
Addicted Member
Re: After click ok button all controls displaying data clear in dataentry form
Hi GM
Sorry for the giving delay response.
Yes exactly i want this..
May i know how can i do??
Thanks for giving support.
-
May 3rd, 2011, 02:33 AM
#5
Fanatic Member
Re: After click ok button all controls displaying data clear in dataentry form
ok, you need to have a clear button on form right. on on the click event of that button type the following code.
textbox1.clear
textbox2.clear
......
after clicking on this button your form will be clear
now go to the click even of the submit or store buttton right.
you might have written the insert query and all other coding right,
where your code get finishes, after that paste the code which you have placed at the click event of clear button.
now when you will enter the entry on form and after clicking the submit button, first the insert query will be operated and then all the controls will be cleared.
-
May 3rd, 2011, 02:36 AM
#6
Fanatic Member
Re: After click ok button all controls displaying data clear in dataentry form
by this way you will be able to clear your form both way, by pressing clear button and by pressing submit button too.
-
May 3rd, 2011, 05:53 AM
#7
Frenzied Member
Re: After click ok button all controls displaying data clear in dataentry form
instead of writing the same code multiple times, put the code in a Sub and then you can call it from anywhere in the form.
-
May 3rd, 2011, 09:56 PM
#8
Thread Starter
Addicted Member
Re: After click ok button all controls displaying data clear in dataentry form
HI GM
Thanks i will try it.
-
May 3rd, 2011, 11:06 PM
#9
Fanatic Member
Re: After click ok button all controls displaying data clear in dataentry form
yes coach barker mentioned the more sophisticated thing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|