Opening a Blank Form (Access 2000)

  • Thread starter Thread starter Anthony Law
  • Start date Start date
If with blank you mean that all the fields are empty you have two choices:
1. Use a form that is based on a table or query, and have one record in the
table which has empty fields, than select that record when you open the
form.

2. Use an unbased form, in which case you will need to wrtie code to move
the data between the tables and the form.

On the other hand, if by blank you really mean blank, than you have some
more work to do, you would need to have code in the form's Open event sub
that sets the Visible property of all controls to False. Then, when you want
to show the contens of the form you would have to write code to make all
controls visible.

Ragnar
 
Anthony Law said:
When a user opens a form, I want the form to be blank.
How do I do this?

Do you mean that you want to open the form so that the user can add new
records, but not view any existing records? You can set the form's
DataEntry property, which will cause it always to display a new blank
record to the user for filling out. Or, if you only want to do this
sometimes, and while remaining able to view or edit existing records
other times, you can open the form in data entry mode using the line of
VBA code

DoCmd.OpenForm "NameOfYourForm", DataMode:=acFormAdd
 
-----Original Message-----
When a user opens a form, I want the form to be blank.
How do I do this?
.
Change the form to a DATA ENTRY form. That way the form
is blank every time it is opened. Open the form in design
view. Click on the properties for the form (the square in
the upper left hand corner). Click on the DATA tab. Set
DATA ENTRY to Yes.
 
Open the form in a desin mode, in the on open event past this code
DoCmd.GoToRecord , , acNewRec
I hope it help


Samer
 
Back
Top