473,385 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
3 3074
NeoPa
32,556 Expert Mod 16PB
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
3,532 Expert 2GB
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
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

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

Similar topics

12
by: guy lateur | last post by:
Hi all, I am trying to write some code (macro's, if you like) to glue together our Office applications (mainly Word, Excel and Outlook). We have a lot of different projects going on...
1
by: Igor Mendizabal | last post by:
Hello We have a VB6 application that integrates an VBA IDE from which the final user can make modifications. We want to pass the application to VB.NET, and the first step, before rethinking...
22
by: Illya Havsiyevych | last post by:
Hello How easily parse VB/VBA code by VB/VBA code ? Is any ready solutions ? Thank's, illya
3
by: Dan Hicks | last post by:
Hi, I wrote this test code as part of a module I created for the Northwind database. However, I was only using this as a test platform. My goal was to write a program that would take records...
6
by: Terry Bell | last post by:
We've had a very large A97 app running fine for the last seven years. I've just converted to SQL Server backend, which is being tested, but meanwhile the JET based version, running under terminal...
1
by: Igor Mendizabal | last post by:
Hello We have a VB6 application that integrates an VBA IDE from which the final user can make modifications. We want to pass the application to VB.NET, and the first step, before rethinking...
16
by: Sathyaish | last post by:
I am expecting a VBA code module in one of the VBA apps, but much to my astonishment, I don't seem to find my way through it. It seems like I am looking at a fully compiled binary. I have an MDB...
12
by: Striker | last post by:
I have never used VB, so sorry for the novice questions. I have a very small app in vba that only uses excel as a place to put a button and some code that I need to move to VB. Now it seems...
25
by: dennijr | last post by:
ok, shell always used to be easy for me, now its starting to get annoying cause i dont know wats wrong heres the simplist code possible: Private Sub IExplorer_Click() a = Shell("C:\Program...
6
by: JFKJr | last post by:
Hello everyone, the following is the Access VBA code which opens an excel spreadsheet and creates combo boxes dynamically. And whenever a user selects a value in a combo box, I am trying to pass...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.