By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,805 Members | 1,349 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,805 IT Pros & Developers. It's quick & easy.

Refreshing a form

P: 21
hi, myself vandana.
I m making a form for new joining of employees. it has almost 30 text boxes.
after clicking add button all feilds should be clear for new entry.
i m using 30 statements in form_load event as below
text1=""
text2=""
-
-
-
text30=""
i wanna know is their any other way to refresh our form.
Mar 21 '07 #1
Share this Question
Share on Google+
5 Replies


100+
P: 149
hi, myself vandana.
I m making a form for new joining of employees. it has almost 30 text boxes.
after clicking add button all feilds should be clear for new entry.
i m using 30 statements in form_load event as below
text1=""
text2=""
-
-
-
text30=""
i wanna know is their any other way to refresh our form.

You can write a single function that will have the list of all the textboxes and the .Text property of each control should be set to "".

thanks
ansuman sahu
Mar 21 '07 #2

vijaydiwakar
100+
P: 579
hi, myself vandana.
I m making a form for new joining of employees. it has almost 30 text boxes.
after clicking add button all feilds should be clear for new entry.
i m using 30 statements in form_load event as below
text1=""
text2=""
-
-
-
text30=""
i wanna know is their any other way to refresh our form.
Yes
Expand|Select|Wrap|Line Numbers
  1.  
  2. private sub ClearAllTextBoxes()
  3. dim Ctrl as control
  4. for each ctrl in me
  5. if typeof ctrl is textbox then ctrl.text=""
  6. next
  7. end sub
  8.  
good luck
Mar 21 '07 #3

samycbe
P: 83
if u want a employee master screen i can send that form to you......


samy
Mar 21 '07 #4

markmcgookin
Expert 100+
P: 648
Yes
Expand|Select|Wrap|Line Numbers
  1.  
  2. private sub ClearAllTextBoxes()
  3. dim Ctrl as control
  4. for each ctrl in me
  5. if typeof ctrl is textbox then ctrl.text=""
  6. next
  7. end sub
  8.  
good luck
Hehe, excellent I never knew about that control class... cheers that's really useful.
Mar 21 '07 #5

P: 21
Yes
Expand|Select|Wrap|Line Numbers
  1.  
  2. private sub ClearAllTextBoxes()
  3. dim Ctrl as control
  4. for each ctrl in me
  5. if typeof ctrl is textbox then ctrl.text=""
  6. next
  7. end sub
  8.  
good luck
thanks. my problem is solved. i must say ur good luck worked well.
thx again.
Mar 23 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.