By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,151 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

(VBA CODE)- to clear entered data on a form

P: 4
Hello,
Not sure if my title was correct, but here is what I am dealing with. I have created a DB that contains different tables that are linked to a form through combo box's. I have createad a command so that once all the entries are selected in the combo box it will save on to a table. What I want is after I save the entry. I would like for the form to close and clear the data that was entered last. I am no expert on VBA code and I need help.

( I believe I am using Access 2000 format)
Aug 14 '08 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,494
What you describe is possible, but probably not necessary.

I don't know if you appreciate that you can have a bound form, some or all of whose controls (matching the table's fields) are ComboBoxes.

This approach would leave you with little or nothing to do.
Aug 14 '08 #2

missinglinq
Expert 2.5K+
P: 3,532
If you only want to be able add a new record with this form, never view existing records, in Form Design View, goto Properties - Data and set Data Entry to Yes.

In the code behind your button, after the code that saves the record, place this line:

DoCmd.Close

Welcome to Bytes!

Linq ;0)>
Aug 14 '08 #3

P: 4
If you only want to be able add a new record with this form, never view existing records, in Form Design View, goto Properties - Data and set Data Entry to Yes.

In the code behind your button, after the code that saves the record, place this line:

DoCmd.Close

Welcome to Bytes!

Linq ;0)>

This was good.It made my form close, and when opened again the fields were clear. I also tried the DoCmd.Restore and it did just the same clearing out my fields without closing my form. Thanks again!!!
Aug 14 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.