Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thank you for the best reply I've ever had to a forum question - it's extremely comprehensive and legible and answers my query thoroughly..."

Geography

Where in the world do Tek-Tips members come from?
comicwizard (TechnicalUser)
24 Feb 12 11:25
Good day, I have a form with several triggers,radial buttons and combo boxes. I would like a way of resetting the form. I thought of using the esc key but I think that would be messy. What I mean by resetting is that I have some radial buttons when choosen disable some combo boxes to prevent them from being used. I would like a way of get the form reset so all fields are available.
Andrzejek (Programmer)
24 Feb 12 12:46
    
Let's say on your Form you have:
a combo box named cboMyCombo
some option (radio) buttons, by default optOne is selected
a command button called cmdReset

CODE

Option Explicit

Private Sub UserForm_Initialize()
    Call StartMyForm
End Sub

Private Sub cmdReset_Click()
    Call StartMyForm
End Sub

Private Sub StartMyForm()

With cboMyCombo
    .Clear
    .AddItem "One"
    .AddItem "Two"
    .ListIndex = 0
End With

optOne.Value = False
optOne.Value = True

End Sub
You can set whatever you want in StartMyForm procedure called from UserForm_Initialize event, and if you want to reset it all to its original state, call it from your cmdReset_Click event.

Would that work for you?

Have fun.

---- Andy

PHV (MIS)
24 Feb 12 12:55
Andy, I guess the OP has an AccesForm, not an UserForm ...
Andrzejek (Programmer)
24 Feb 12 13:38
   
You may be right PHV, but I would think the same logic would apply: set all initial settings in some procedure and call this procedure at the beginning of the project, and from some Reset button.

Have fun.

---- Andy

comicwizard (TechnicalUser)
24 Feb 12 13:41
This is in microsoft access 2007.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close