Forms

G

Guest

After spending hundreds of hours troubleshhoting forms used for data
entry, I have decided that (except for a simple form based on a single table)
from now on all forms I create will use unbound controls for data entry and
a SAVE button. The OnClick event of SAVE will take the data from the unbound
controls and use recordsets to store the data in the appropriate tables. I
know this means writing more VBA code, and the App may run a little slower,
but I'm convinced it will save me alot of development time. I have run into
several very frustrating cases where using unbound controls was the only way
I could get it to work after many hours of trying.
My question is, am I setting myself up for some other problems?
What are the cons of doing this? Am I missing something in thinking this
will be foolproof?

Any thoughts would be greatly appreciated. Thanks
Garry Gross
 
S

Steve Schapel

Garry,

Maybe someone else will be able to comment on the pros and cons of
entering and editing data programmatically via unbound controls, as my
experience with this is limited.

However, I can say that your experiences with using bound forms have
apparently been very differnet from mine. The rich functionality with
bound controls, along with the abilities of subforms, are for me key
aspects that makes Access the great tool that it is. Like any tool, the
more you use it, the more proficient you become. I would say that for
me, the use of bound forms would almost always be hugely simpler than
trying to do the equivalent with code.

As regards the "several very frustrating cases where using unbound
controls was the only way I could get it to work after many hours of
trying", I obviously don't know what the problem could have been there,
without knowing the details. But there is probably an explanation, and
a simple way to make it work with bound controls, and I would be
cautious about throwing the baby out with the bathwater.
 
G

Guest

Steve,
Thanks for the “pep talkâ€. You are right, of course. I was just venting
frustration after spending a week trying to get a particular form to work.
The form had one control for entering data, and 8 others, including a sub
form, showing existing data so the user could decide what to enter. The only
control on the form that was enabled was the one that needed user input and
no matter what I tried, the control acted like it was enabled but locked –
could put cursor in control but could not enter anything. The only way I
could get it to work was to unbind it from the table and transfer the value
to a recordset based on the table in code. I am beginning to think that the
problem is that the query that the form is based on is very complicated (at
least to newbe like me) It includes 5 tables with 3 inner joins, and maybe
something “deep inside†Access that I am not familiar with was preventing the
control to be changed. I am new to Access (about 3 months) and I just
couldn’t figure it out. But the unbound control works fine so I am going to
keep it that way.

Garry Gross
 
R

Rick Brandt

Garry said:
Steve,
Thanks for the "pep talk". You are right, of course. I was just
venting frustration after spending a week trying to get a particular
form to work. The form had one control for entering data, and 8
others, including a sub form, showing existing data so the user could
decide what to enter. The only control on the form that was enabled
was the one that needed user input and no matter what I tried, the
control acted like it was enabled but locked - could put cursor in
control but could not enter anything. The only way I could get it to
work was to unbind it from the table and transfer the value to a
recordset based on the table in code. I am beginning to think that
the problem is that the query that the form is based on is very
complicated (at least to newbe like me) It includes 5 tables with 3
inner joins, and maybe something "deep inside" Access that I am not
familiar with was preventing the control to be changed.

Many queries render result-sets that are read only. There is a whole help
topic dedicated to this "When can I update data in a query?" While having
more than one table doesn't automatically render a query non-updateable, the
more tables you add the more likley that the result will be read only.
 

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