Help with "Undo" Please

S

Shadow

How can I reset a form?

The form is an unbound form and the users inputs some values or selects some
options to search tblOrder table. I need when the user click a button, all
the textboxes, frames and everything else goes back to their default values.

"Me.Undo" doesn't work out. Maybe because the form is unbound.


any kind of help is much appreciate.



thanks in advance
 
M

Marshall Barton

Shadow said:
How can I reset a form?

The form is an unbound form and the users inputs some values or selects some
options to search tblOrder table. I need when the user click a button, all
the textboxes, frames and everything else goes back to their default values.

"Me.Undo" doesn't work out. Maybe because the form is unbound.


Either I don't understand your problem or you can just add
code behind the button that assigns your "default" value to
each control.
 
R

rick

Shadow said:
How can I reset a form?

The form is an unbound form and the users inputs some values o
selects some
options to search tblOrder table. I need when the user click
button, all
the textboxes, frames and everything else goes back to their defaul
values.

"Me.Undo" doesn't work out. Maybe because the form is unbound.


any kind of help is much appreciate.

how about using the DefaulValue property? It's based on the Defaul
Value that is defined in the controls property.

Private Sub resetDefaults_Click()
myfirstTxtbox = myfirstTxtbox.DefaultValue
mysecondTxtbox = mysecondTxtbox.DefaultValue
mythirdTxtbox = mythirdTxtbox.DefaultValue
...
End Sub

Not sure if this is what you are looking for..
 
R

rick

Shadow said:
How can I reset a form?

The form is an unbound form and the users inputs some values o
selects some
options to search tblOrder table. I need when the user click
button, all
the textboxes, frames and everything else goes back to their defaul
values.

"Me.Undo" doesn't work out. Maybe because the form is unbound.


any kind of help is much appreciate.

how about using the DefaulValue property? It's based on the Defaul
Value that is defined in the controls property.

Private Sub resetDefaults_Click()
myfirstTxtbox = myfirstTxtbox.DefaultValue
mysecondTxtbox = mysecondTxtbox.DefaultValue
mythirdTxtbox = mythirdTxtbox.DefaultValue
...
End Sub

Not sure if this is what you are looking for..
 
S

Shadow

thanks Marshall and Rick,

I was imagining there should be something else for unbound forms instead of me.undo
It seems that using a loop and resetting all the controls in a form by defaultvalue property is
the only way left for me.


thanks for your advices.

shadow


How can I reset a form?

The form is an unbound form and the users inputs some values or selects some
options to search tblOrder table. I need when the user click a button, all
the textboxes, frames and everything else goes back to their default values.

"Me.Undo" doesn't work out. Maybe because the form is unbound.


Either I don't understand your problem or you can just add
code behind the button that assigns your "default" value to
each control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top