Open Form in Add Mode

G

Guest

Any idea why a form would not open to a new record?

When my custom form was having this trouble, I created a wizard made
switchboard just to troubleshoot. I selected Add mode, and it still didn't
work. I then tried setting the data entry property to yes on the form's
properties too.

To verify the add mode options above worked at all, I changed stDocName to a
different form leaving the command line itself alone, all they all worked
perfectly. It is only this one form.

The form is very simple, it is a staff information form (name, rank, contact
info). Yet, nothing seems to actually open this form up in add mode.

Any ideas?
 
G

Gary Miller

If your underlying recordset is not updatable this can
happen. Is the form based on a query? Open the query by
itself and see if you can enter a new record. Also check
your AllowAdditions property.
 
G

Guest

Thank you for replying Gary,

The record source is a table, and it is perfectly updatable. I can all
the records I need, but only after tabing through to a new record. It simply
won't open in add mode and I am stumped.
 
G

Gary Miller

Renee,

I am a little confused by a couple of thing that you have
mentioned.

" I can all
the records I need, but only after tabing through to a new
record."

Is this saying that you can see all of the records on the
form and you can get to a new record add at the end so that
your only problem is not being able to open in DataEntry
mode where the new record entry is the only record being
displayed? If so see the DataEntry suggestion below.

"I created a wizard made
switchboard just to troubleshoot. I selected Add mode, and
it still didn't
work."

This doesn't surprise me as the Switchboard Wizard normally
creates a form that is not bound to an underlying table and
isn't designed to display records. It would have no clue
what to add where.

Here are some troubleshooting isolation steps.

.... Make sure that the form's AllowAdditions Property is set
to Yes.

.... Set the form to DataEntry. The form should then then
open to a blank new record for entry. Does this happen?

.... Try opening the form directly from the database window
instead of your code. Any difference in what happens?

.... Perform a compact and repair on the database in case
that form got corrupted somehow. A more drastic but
sometimes effective approach to solving corruption is to
create a new database and then import all of your objects
from the first one into the new database container

I'll be curious to hear what works or doesn't.

Gary
 
G

Guest

The form shows only one record at a time. The AllowAdditions is yes, the
AllowDeletions is no. I have toggled the DataEntry back and forth to test
that as well. Regardless of whether or not I open the form from the window
(with dataentry set to yes) or open it from a command button with Add
Mode...it would not open to a new record.

I changed the record source:
It was a table.
I changed it to a query. All the query does is select all from the table.

After that, it opens in add mode perfectly. I have no idea as to why a form
based on a table versus a form based on a select all query would have that
issue. I was able to add records with both sources just not open a form in
add mode. I had never come across anything like this before.

Thank you for your time Gary!
Renee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top