Controls disappear from Data Entry form

P

Paul Ponzelli

I have a form in the front end of an Access 2002 database used only for Data
Entry. The form contains several labels, text boxes and combo boxes bound
to a select query Record Source. It usually works just fine, but sometimes
when the form opens, none of those form controls are visible.

The form has the following property settings:

Allow Filters: Yes
Allow Edits: Yes
Allow Deletions: Yes
Allow Additions: Yes
Data Entry: Yes
Recordset Type: Dynaset
Record Locks: No Locks
Fetch Defaults: Yes

Popup: No
Modal: No


This is very puzzling because most of the time when the form opens, all
controls are clearly visible. However, sometimes, when the form opens, none
of the controls are visible. This behavior occurs on several different
computers, and it happens regardless of whether I open it from the
switchboard main form, or double-click on the form object in the database
window.

It's especially puzzling because it doesn't happen all the time. Can anyone
tell me what might be causing this to happen?

Thanks in advance,

Paul
 
G

G. Vaught

This can happen if the first record in the table does not contain any data
to activate the form for data entry. If the form is used for additions only,
set Allow Edits to NO.
 
D

Duane Hookom

This usually suggests the form's record source is not updateable. Is your
form based on more than one table? If so, are they joined on primary and
foreign keys?
 
P

Paul Ponzelli

I set Allow Edits to No, and it seems to be working fine.

Thanks for your help with this, G.
 
P

Paul Ponzelli

Thanks for your reply, Duane.

I followed the kind suggestion from G. Vaught and set the AllowEdits
property to False in the Open event of the Data Entry form, and found that
the form controls will display on some computers, but they won't display at
all on others. When the form opens on those other computers, it's
completely blank - none of the controls are visible.

The Record Source of this form is a query based on a single table, having
the form

SELECT fields
FROM table
ORDER BY field

The query is a Dynaset with no record locks, and there are some calculated
fields with 5 or 6 layers of nested IIF() statements. It's definitely
updateable, in both (other) forms and directly in query datasheet view.

This is really puzzling to me. One possible solution that occurs to me is
to set the Data Entry property of the form to "No" in the form open and
close events, but set the same property to "Yes" in the form Load event
(since it fires after the Open event) in the hopes that it might solve the
problem, but that seems like one guy holding the light bulb while three
others spin the ladder.

This is really a puzzle, because

the form is based on a one-table query
the query is definitely updateable
it doesn't always happen on a given computer, and
it always happens on some computers.

Any idea what could possibly cause this behavior?

Thanks again in advance.

Paul
 
D

Duane Hookom

Do all users have read/write/create/delete permissions in the folder
containing the data mdb? If they all do then I don't have a clue :-(
 
P

Paul Ponzelli

Aha! No, my users didn't have Write permissons. I just put them in, and
now it works. Duane, you're a genius.

Thanks again to Duane Hookom and G. Vaught.
 
D

david epsom dot com dot au

The details section of a form is not painted if
there are no records.

If you have no records at all, not even a new
empty record, then the detail section of the
form will not be painted.

You can set the filter on your form, save the
form, and then delete the record.

When you re-open the form, the form will go to
a 'new' record if it can. If it can't, and
all of the records are filtered out, the detail
section of the form will not be painted.


If you can't write a new record, because the
recordsource is read only, for design reasons or
because you don't have write permission on the
folder, then you can't get a new record.

Sometimes you may want a bound form where there
are no records, not even a new empty record.
In that case, you need to put controls in the
form header or footer section, because the form
header and footer sections are always painted,
even when there is no record.

(david)
 
P

Paul Ponzelli

Thank you for this additional insight, David. I do have a question about
one of the points you made:
If you have no records at all, not even a new
empty record, then the detail section of the
form will not be painted.

If a form has the Data Entry and Allow Additions properties set to "Yes,"
an updateable Record Source and Write permissions, shouldn't it always be
possible to create a new record?

I'm having trouble understanding how you could not have a new empty record
when you have an updateable recordset. If the Recordset Type property of a
query is set to either type of Dynaset, then you're always going to have a
new empty record, aren't you?

Thanks again in advance,

Paul
 
G

Guest

That's right., only when there is a non-updateable
recordset. It looks like in your case, the problem
was caused by lack of permission's on the folder?

It's one of those problems that is so rare, that at first
you don't recognise it when it happens.

Another example, you might have a read-only form with
an Add and an Edit button. It works ok in test, but when
you clean out the sample data and deliver to the client,
you find that there is no way to Add the first record,
because the Add button is not shown unless there is
data.

(david)
 

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