Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

blank fields

Status
Not open for further replies.

mama16

MIS
Oct 22, 2004
125
US
How can I clear out the fields when entering a new customer. For example on the form when hitting add customer, I'd like for the rest of the fields to appear blank.
Any ideas?

Thank you
 
DoCmd.GoToRecord , , acNewRec

Add the above code to your new customer command button and the form will clear all fields in anticipation of a new recoprd being added. Any fields with a default value will display the dafault value.

I haven't failed, I have just found 10,000 ways that it won't work!
 
It's already there.

Private Sub cmd_add_Click()
On Error GoTo Err_cmd_add_Click


DoCmd.GoToRecord , , acNewRec

Exit_cmd_add_Click:
Exit Sub

Err_cmd_add_Click:
MsgBox Err.Description
Resume Exit_cmd_add_Click

End Sub


The rest of the fields are not coming blank



 
Let me see if I understand - when you click on the New Customer control, the current record remains in place - i.e. nothing happens?

It may be that youe Event Procedure is not attached to the control if this is the case & you are therefore not really adding a new record.

I haven't failed, I have just found 10,000 ways that it won't work!
 
The rest of the fields are not coming blank
Are they are bound ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top