Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to reset a custom search dialog form?

0 views
Skip to first unread message

Doug Vernon

unread,
Aug 8, 2003, 12:35:36 PM8/8/03
to
I have created a custom dialog box with several unbound
object frames. The unbound object frames are used to
enter variables used by a query. I would like to make a
command button that will clear the contents (or "reset")
of all of the unbound object frames on the form.

My current method for "resetting" the form is by using a
macro that closes the form, then re-opens it. . . it
works but it is not very smooth looking.

Any ideas would be greatly appreciated.

DV

Doug Vernon

unread,
Aug 8, 2003, 1:38:20 PM8/8/03
to
The custom dialog box actually contains "unbound text
boxes" instead of unbound object frames.
DV
>.
>

Gary Miller

unread,
Aug 8, 2003, 1:48:27 PM8/8/03
to
Doug,

Here is some sample code from a criteria form that I use. Hope it helps. The
error numbers in the error handler take care of trying to set a control to
null when it is a type that doesn't have a value.

Gary Miller

' **************************************
Private Sub cmdReset_Click()
On Error GoTo ResetError
Dim Frm As Form, Ctl As Control

Set Frm = Me
For Each Ctl In Frm
Ctl.Value = Null
Next Ctl

ResetError:
If Err = 2119 Or Err = 438 Or Err = 2448 Then
Resume Next
ElseIf Err > 0 Then
MsgBox Err & ": " & Err.Description
End If
End Sub
*************************************************

"Doug Vernon" <dve...@sewsus.com> wrote in message
news:01c101c35dcb$18335f30$a101...@phx.gbl...

Joan Wild

unread,
Aug 9, 2003, 12:49:13 PM8/9/03
to
You can just use
Me!txtNameOfTextbox = Null

--
Joan Wild
Microsoft Access MVP


"Doug Vernon" <dve...@sewsus.com> wrote in message

news:004601c35dd3$dbe338d0$a501...@phx.gbl...

0 new messages