I am giving the user the option of entering a new record. If they select yes, I am trying to clear the fieldand reset the combo boxes to Null. Here is the code that I was using:
[code]
If MsgBox("Would you like to enter another record?", vbYesNo) = vbYes Then
For Each oneControl In frmDataForm.Controls
Select Case TypeName(oneControl)
Case "TextBox"
oneControl.Text = vbNullString
Case "ComboBox"
oneControl.Index = Null
End Select
Next oneControl
Else
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "frmHome", acNormal, "", "", , acNormal
End If
[code/]
When I select Yes, I get the following error on the "You can't reference a property or method for a control or unless the contro has the focus."
Do I need to set the focus on each object before clearing it? If so, any recommendation on how to do it in the loop?