Hi guys
Using access 2007
Basically i have created a form (Majority unbound) and wanted the user to be able to save the form (done) and then clear the form in order to input the new data.
I already have a clear button that clears a majority of the controls on the form using this VBA code
Private Sub Clear_form_Click()
Dim ctl As Control
On Error Resume Next
For Each ctl In Me.Controls
ctl.Value = ctl.DefaultValue
Next
Set ctl = Nothing
End Sub
This is all well except one point :
The last text box doesn't clear, instead it says #Error. The Text box is simple i just created it from the MS ribbon and entered the name of it and a simple calculation which is : =[Quantity]-[Quantity_out].
this obviously means that not all the controls are clear and new so How exactly do i over come this??
Anything else i can do please ask
Thankyou!!