Reset code . . one last question

  • Thread starter Thread starter Doug Vernon
  • Start date Start date
D

Doug Vernon

I followed your instruction regarding "Re: cmdRESET_Click
()" reply message . . . IT WORKS!!!!

Now I have another issue. There are 2 controls on this
same form (custom dialog) that are bound to a table. I
do not wish to set the value of the bound controls to
null. Is there a way to specify in the procedure
to "ignore" or bypass these 2 (bound) controls?

Thanks again!!! dv
 
Doug,

Glad that you got it working. Actually I had the same thing with some
exceptions on the form I grabbed the code from. I will know include my whole
reset code so you can get an idea of how I handled with some IF statements.

Gary
*********************************
On Error GoTo ResetError

Dim Frm As Form, Ctl As Control
Set Frm = Me
For Each Ctl In Frm
If Ctl.Name = "Crop Year" Then
' Do Nothing except loop to Next ctl
ElseIf Ctl.Name = "Agent" Then
' Do Nothing except loop to Next ctl
ElseIf Ctl.Name = "Certified" Then
Ctl.Value = Null
Me.lblCertified.Caption = "Not Selected"
Else
Ctl.Value = Null
End If
Next Ctl
' Here I reset the list source of a combo box that was just cleared by the
above code
Me!Variety.RowSource = "SELECT DISTINCTROW [qryVarieties].[Variety] FROM
[qryVarieties];"

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
*****************************
 
Back
Top