PC Review


Reply
Thread Tools Rate Thread

bound forms vs. unbound forms

 
 
BillE
Guest
Posts: n/a
 
      3rd Jan 2008
There were angry words on this group a couple of days ago on this topic.
I'm wondering what the consensus of other Access developers is regarding
bound forms and unbound forms.

I often use unbound forms and I create classes, like a Customer class with
properties used to AddCustomer, UpdateCustomer, etc. I will also have a
data access class which perfoms all data related tasks. I also do a lot of
VB.Net development and I feel more comfortable using a sort-of object
oriented approach. I also find that complex forms with subforms are easier
to manage when unbound. It seems easier to locate problems, by stepping
through the code. Maybe if I spent some time learning to use bound forms
better, there wouldn't be problems to solve.

I don't necessarily advocate unbound forms, that is just how I often do it.
Most projects are a mixture of more complicated unbound forms and simpler
bound forms, like popups for adding comments.

I like Access because of the reporting, easy GUI design and implementation,
the database schema tools, the query tools, etc. But not so much for bound
forms.

To be honest, I don't like to use complicated bound forms because I always
seem to end up trying to figure out the reason for some referential
integrity violation or something and I find it is easier to just write code
where I know exactly what is happening.

This certainly must be because I have not mastered the techniques of
developing in Access with bound forms and have taken the lazy way, since
advanced developers seem to prefer bound forms.

However, it doesn't take me that long to write code to do what a bound form
would do even if it worked the way I want it to.

Hopefully nobody is offended by this - I'm just curious about other views.

Bill


 
Reply With Quote
 
 
 
 
boblarson
Guest
Posts: n/a
 
      3rd Jan 2008
I, for one, don't like writing code where I don't have to, so I tend to use
bound forms and letting Access handle the details of a lot of it. So, I like
bound forms myself. But, I've used unbound too, on occasion, when I needed
to do something that a bound form either didn't do, or would have taken more
to do than just using an unbound form.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________


"BillE" wrote:

> There were angry words on this group a couple of days ago on this topic.
> I'm wondering what the consensus of other Access developers is regarding
> bound forms and unbound forms.
>
> I often use unbound forms and I create classes, like a Customer class with
> properties used to AddCustomer, UpdateCustomer, etc. I will also have a
> data access class which perfoms all data related tasks. I also do a lot of
> VB.Net development and I feel more comfortable using a sort-of object
> oriented approach. I also find that complex forms with subforms are easier
> to manage when unbound. It seems easier to locate problems, by stepping
> through the code. Maybe if I spent some time learning to use bound forms
> better, there wouldn't be problems to solve.
>
> I don't necessarily advocate unbound forms, that is just how I often do it.
> Most projects are a mixture of more complicated unbound forms and simpler
> bound forms, like popups for adding comments.
>
> I like Access because of the reporting, easy GUI design and implementation,
> the database schema tools, the query tools, etc. But not so much for bound
> forms.
>
> To be honest, I don't like to use complicated bound forms because I always
> seem to end up trying to figure out the reason for some referential
> integrity violation or something and I find it is easier to just write code
> where I know exactly what is happening.
>
> This certainly must be because I have not mastered the techniques of
> developing in Access with bound forms and have taken the lazy way, since
> advanced developers seem to prefer bound forms.
>
> However, it doesn't take me that long to write code to do what a bound form
> would do even if it worked the way I want it to.
>
> Hopefully nobody is offended by this - I'm just curious about other views.
>
> Bill
>
>
>

 
Reply With Quote
 
Albert D. Kallal
Guest
Posts: n/a
 
      4th Jan 2008
For sure this issue of bound forms VS unbound forms can always conjure up
quite a heated discussion.

The major problem here is that most developers coming from other
environments are used to an unbound type of design model.

Furthermore when you need richer or more complicated interfaces in MS
access, you really only have two choices:

apporach #1) Reduce the complex user interface and design your application
with the MS access interface in mind.

I can't stress how critical the concept this is that you *make* your desings
fit access. For example, we don't have the ability to put a continuous form
inside of a continuous form. However often we need this type of many to many
UI. A great example of this is the classical distribution of funds from a
given check amount. That is you enter a check value of amount into one
column, and then must distribute the total check amount into other expense
accounts. I can't say every person who's done a lot of business software has
encountered this type of interface, but pretty much every one had to do this
type of code once in their life.

We really don't have a drill down control in MS access to accomplish this.
So the solution was rather simple, but the simplicity is a result of
sticking to what WORKS in the MS access interface.

The interface design I used as a screen shot is posted here:

http://www.members.shaw.ca/AlbertKal...icles/Grid.htm

(just quickly scroll down to the very last screen shot, you'll see the list
of people and check amounts on the left side of the screen. On the right
side I'm able to distribute the funds of the check out to "many" separate
accounts, but they both must balance.

So the solution I came up with was to simply placed two sub forms into a
main form, and the result works really wonderful. Again I can't stress that
the lesson we learned here is that you must design for the MS access
interface, not the other way around.

approach # 2) consider unbound forms to get the contorl or interface we
need, or better yet simply dump the use of MS access.


The main problem with using unbound forms in MS access is that you give up
the complex forms object model. Of course the access forms object model is a
labyrinth of events. It most certainly can be confusing and catch you with
your pants down often (That's your comments about making this confusing
often makes sense). However, it is this complex object model that also gives
us the wonderful power and speed of development that MS access has.

The instant you break outside of this bound design model, you give up all
the tools and wizards and everything that is built in to give you high
productivity that access is famous for.


A great example is all the extra events we have when you use bound forms,
for example just think of what occurs when you load up a form:

compared to VB, we have TWO significant and two distinct events that occur
when a form loads (Compared to vb's 1 event).

we have:

1) on-open event
The on open event is a really cool event because allows you to have code
test for conditions that will actually prevent the form from a actually
loading (and becoming visible). Furthermore this event is too soon to
actually modify data on form's controls (but you can inspect values in
contorls). The beauty of this event is thus that you can actually build
things like record locking code, and if you fail to get a record lock on
your data, then you can prvent the form from loading.

It is only after all of your so-called test code, or criteria code passes
that the form can then continue to the on-load.

2) on-load event
The on load event is were all of your forms setup code, variable
initialization code etc goes (in fact it's just wonderful to have two events
to force developers to distinguish and palce different kinds of start up
code in two different places for that form -- as the develop or I know
exactly where to look for the initialization setup code, and I also know
where exactly to look for for code that will canceled and prevent the form
from loading -- in vb land this distinction is never made nor is it
formalized in such a nice way). furthermore what's really nice is if you're
all on open event cancels, then your setup and in its place nation code in
on load will never run.

My point here is that if you start using unbound forms then you essentically
give up the wonderful two separate features and events. For a unbound form
to use the on open event to cancel a form load, then you'll have to put in
all of your setup code, and all of your data binding code into that on open
event, and that's gonna get a bit messy (and if you move all the code to be
on load event, then you'll actually see the form appear). I sure wish the vb
environment had a really nice event that you could cancel the form load (and
have a wonderful place holder for the cancel code *in* the form like access
does). In the VB environment you're calling code gonna have to set this up,
and it's messy to cancel a form load without the form being viewed at all.

Furthermore bound forms have a ton of events such as before update, after
update, before del confirm, after dell confirm.....the list goes on and
on...its huge.

We can have a user selects several records on a form or continuous form, and
then hit the delete key, and the appropriate delete code will repeatedly run
for you automatically. To duplicate this type of behavior is in un bound
form is going to take a lot of code writing.

Furthermore there's just tons of little things like for example

if me.newrecord then

hey, this is a new record, let's do something different ...

or

if me.dirty = true then

hey, the user has modified some data on some control, let's do something
else

So we have the use of all kinds of little flags and form settings to tell us
if this is a new reocrd, or the form is dirty. And, we don't just have one
event like the reocrd being updated, but we have before update, an after
update, on insert new record, and the list goes on and on again.

Each one of these events when used in the correct specific manner, yields
incredible productivity from a developer's point of view. The trick as I
stressed is you must design your applications around the correct use of
these events.

The instant you use unbound forms, you give up all of these events, and you
give up all of the settings like dirty, new record, etc and they cannot be
used.

In these other environments they have a very rich host of tools built around
an unbound forms object model. Therefore these other environments provide
truckloads of special data connectors, data binding options, and all kinds
of things that are built around forms that are not data bound. In fact you
have years of tools desinged around a unbound object model.

The problem is when you move an unbound design approach to MS access, you're
getting the worst of both worlds, because you can't use the massive amount
of built in data features that a form has, and you also have no support and
no bunch of wizards built to help you do all that data connecting that these
other un bound platforms have.

In effect you'll be writing code at a slower pace than those other
development platforms because they have all the super duper wizard and data
connection stuff build around their model. We have no such rich feature set
and tools to do that data binding in MS access, and therefore you give up
all the wizards and support.

There's certainly times when you want to use unbound forms for a lot of user
interface prompt type stuff. However if you've reached the point where you
find that the interface requirements you have need un-bound forms a lot,
then you starting to fit a square peg in a round hole.

You'll likely be more productive in an environment that's designed for
unbound forms, and gives you the kind of "fine" control and interface that
you need in your applications.

Unfortunately access is not really designed around that unbound concept, and
you certainly do have to give up a lot of features and things when you go
the bound road. as always on these issues and matters your mileage may
certainly vary, but I just think the price is too high to pay for un bound
forms, and perhaps for your situation you don't consider the price versus
the benefits too high of a cost.


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)


 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      4th Jan 2008
"BillE" <(E-Mail Removed)> wrote:

>I'm wondering what the consensus of other Access developers is regarding
>bound forms and unbound forms.


I quite like using bound forms and for the most part use them. Other
than a switchboard form I use unbound forms maybe 1% of the time.

>To be honest, I don't like to use complicated bound forms because I always
>seem to end up trying to figure out the reason for some referential
>integrity violation or something and I find it is easier to just write code
>where I know exactly what is happening.


I suspect the biggest problem there might be in figuring out how to
properly use subforms. It does take a bit of work at the beginning
to really understand what is going on their.

>This certainly must be because I have not mastered the techniques of
>developing in Access with bound forms and have taken the lazy way, since
>advanced developers seem to prefer bound forms.


I wouldn't say lazy so much as you are going with a route that you are
familiar with. I suspect your approach is a lot more work.

>Hopefully nobody is offended by this - I'm just curious about other views.


Not offended at all. A good discussion is always useful.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      4th Jan 2008
"BillE" <(E-Mail Removed)> wrote:

>There were angry words on this group a couple of days ago on this topic.


What was the subject of the posting? I must've missed that
discussion. I like a good scrap. <smile>

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Reply With Quote
 
Steve Schapel
Guest
Posts: n/a
 
      4th Jan 2008
Hi Albert,

Albert D. Kallal wrote:
> ... We really don't have a drill down control in MS access to accomplish this.


Subdatasheet?

--
Steve Schapel, Microsoft Access MVP
 
Reply With Quote
 
Albert D. Kallal
Guest
Posts: n/a
 
      4th Jan 2008
"Steve Schapel" <(E-Mail Removed)> wrote in message
news:%233aSL%(E-Mail Removed)...
> Hi Albert,
>
> Albert D. Kallal wrote:
>> ... We really don't have a drill down control in MS access to accomplish
>> this.

>
> Subdatasheet?
>
> --
> Steve Schapel, Microsoft Access MVP


Hum....I can only say there is always some really smart and bright and
intelligent guy who sits in the back of the class and is part of the quiet
peanut gallery. He's always near genius, and always waits to throw a little
wrench into the discussion that makes a really great point......

I consider you one of you of those great brains sitting quietly behind the
scenes in the peanut gallery ......just waiting to point out a great idea
when the time not 100% perfect to do so!!!

;-)

True, quite true.......a sub datasheet is a very possbile UI
solution.........


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)


 
Reply With Quote
 
Beetle
Guest
Posts: n/a
 
      4th Jan 2008
He might be talking about this thread

http://www.microsoft.com/communities...xp=&sloc=en-us

I'm with you. Nothing like a good scrap to liven things up a little (within
reason of course). Here's a couple more threads you might find mildly
entertaining.



http://www.microsoft.com/communities...xp=&sloc=en-us

http://www.microsoft.com/communities...xp=&sloc=en-us

--
_________

Sean Bailey


"Tony Toews [MVP]" wrote:

> "BillE" <(E-Mail Removed)> wrote:
>
> >There were angry words on this group a couple of days ago on this topic.

>
> What was the subject of the posting? I must've missed that
> discussion. I like a good scrap. <smile>
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Please respond only in the newsgroups so that others can
> read the entire thread of messages.
> Microsoft Access Links, Hints, Tips & Accounting Systems at
> http://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
>

 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      4th Jan 2008
"Albert D. Kallal" <(E-Mail Removed)> wrote:

>>> ... We really don't have a drill down control in MS access to accomplish
>>> this.

>>
>> Subdatasheet?
>> Steve Schapel, Microsoft Access MVP

>
>Hum....I can only say there is always some really smart and bright and
>intelligent guy who sits in the back of the class and is part of the quiet
>peanut gallery. He's always near genius, and always waits to throw a little
>wrench into the discussion that makes a really great point......
>
>I consider you one of you of those great brains sitting quietly behind the
>scenes in the peanut gallery ......just waiting to point out a great idea
>when the time not 100% perfect to do so!!!
>
>;-)


Hehehehehehehehehehehe

>True, quite true.......a sub datasheet is a very possbile UI
>solution.........


With the accompanying performance hit of enabling subdatasheets.

Tony (still chuckling)
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Reply With Quote
 
Steve Schapel
Guest
Posts: n/a
 
      4th Jan 2008
Tony Toews [MVP] wrote:
>
> Hehehehehehehehehehehe


Agreed. :-)

>> True, quite true.......a sub datasheet is a very possbile UI
>> solution.........

>
> With the accompanying performance hit of enabling subdatasheets.


Not that I am aware of, Tony. I think you are talking about the
Subdatasheet Name property of tables. I was referring to using a
subform as a subdatasheet on a datasheet view form, which is an entirely
different question. No?

--
Steve Schapel, Microsoft Access MVP
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Confusion with bound/unbound fields on forms =?Utf-8?B?cmljaA==?= Microsoft Access Form Coding 2 26th Jul 2007 03:12 AM
Unbound and Bound Object Frame in Forms =?Utf-8?B?S2FyZW4gSmVubnk=?= Microsoft Access 0 21st May 2007 12:36 PM
Bound vs Unbound Forms =?Utf-8?B?V0NN?= Microsoft Access Forms 6 17th Oct 2006 08:20 AM
Converting unbound forms to bound =?Utf-8?B?YW1pbg==?= Microsoft Access Forms 2 15th Aug 2005 06:27 PM
reference two forms (one bound - one unbound) =?Utf-8?B?aG5nbw==?= Microsoft Access VBA Modules 2 27th Jul 2005 09:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:41 AM.