Subforms vs Good ol fashioned coding

  • Thread starter Thread starter Dave Cousineau
  • Start date Start date
D

Dave Cousineau

im a self-taught Access programmer, and I almost never use
fancy things like bounded controls and subforms.

whenever a form loads, i take any data it needs and load
it into arrays, and i use these arrays to populate the
controls on the form via callback functions. then when the
user interacts with the controls, i index into my arrays
to get at the specific information the user is requesting.

i use the OpenArgs parameter to pass information from form
to form.

i definitly prefer coding, since i can pretty much make my
programs do anything i, or my client, want them to do.

am i really missing anything all that great by not using
bounded controls, and subforms?
 
im a self-taught Access programmer, and I almost never use
fancy things like bounded controls and subforms.


That's like saying: "I'm a self-taught cook, and I almost never use fancy
things like frying pans and weighing scales"!

Bound controls lets you produce a basic view/add/edit/delete form with
little or even no coding. You need >tons< of code to produce an equivalently
capable unbound form.

Subforms let you easily display the recrds on the "many" side of a 1 to many
relationship. Sure, you could code that all yourslf. But why bother? It's
like saying, "I hate calculators, I'll do it all in longhand!"

HTH,
TC
 
heh

well its just that you have such better control when you
code it all. theres almost nothing i can't do (within
reason) with the data since i load it into ram. the main
drawback is things can get pretty slow when you have
really large lists of data. i usually get around that by
either writing a good sort and filter interface, or by
using a subform

when i do use a subform i cant stand that i have such
little control over the data.
 
What is a specific example of where a subform gives you insufficient control
of the data?

(Perhaps you are missing something about subforms?)

TC
 
Rick Brandt said:
Well there is that pesky problem where Access keeps trying to save the data
entered by the user. We all know that just because a user is pounding on those
keys that doesn't mean they're really serious :-)

Exctly! Tim Ferguson recently described a terrific new product that lets the
code determine whether the user actually >meant< to press a key, or only did
it accidentally. I've googled for that post, but I can't find it. What a
product >that< would be!

Cheers,
TC
 
Dave, none of that is anything to do with subforms.

To get the value of the field in the underlying recordset of a form, just
use: Me![TheFieldName] from within the form's code module. It is
irrelevant whether the form is running as a main form, or a subform.

I think you will find that there are few good reasons to avoid subforms.

HTH,
TC
 
yes its quite possible its just my lack of understanding
how it works

i never have figured out how exactly you get any data out
of a subform

is it even possible, for example, to get the ID of the
selected record?

what if i want all my combo boxes to start with the same 2
values, and then each list their own unique contents?
(a window i made recently has about 15 combo boxes that
start with '<All>' and '<not specefied>', and then list
their own unique contents)

indexing into an object list using ListIndex allows me to
obtain all data for the selected record. i can then pass
the ID of the record to a different form or control and
load information based on that ID. also since i have the
data in the RAM already, its easy as pie to pump it into
an excel sheet. all searching, filtering, and sorting is
done with the SQL that i use to get the data into the ram
 
TC said:
What is a specific example of where a subform gives you insufficient control
of the data?

(Perhaps you are missing something about subforms?)

TC

Well there is that pesky problem where Access keeps trying to save the data
entered by the user. We all know that just because a user is pounding on those
keys that doesn't mean they're really serious :-)
 
is it even possible, for example, to get the ID of the selected record?

Ah, I misunderstood what he meant. I would say:

me![NameOfSubformControl].form![ID]

from within the main form.

Cheers,
TC
 
yes its quite possible its just my lack of understanding
how it works

i never have figured out how exactly you get any data out
of a subform

is it even possible, for example, to get the ID of the
selected record? me.subform.Form.Fields("ID").value

what if i want all my combo boxes to start with the same 2
values, and then each list their own unique contents?
(a window i made recently has about 15 combo boxes that
start with '<All>' and '<not specefied>', and then list
their own unique contents)

When I can be bothered, I use a dummy table with these two values in
them, (Well actually All &Any) Then do a union query on that with the
"real" rowsource
More often, I just drop a radioButton "All" next to the List box (I
always use a List box for multi select) and read that in the code.
indexing into an object list using ListIndex allows me to
obtain all data for the selected record. i can then pass
the ID of the record to a different form or control and
load information based on that ID. also since i have the
data in the RAM already, its easy as pie to pump it into
an excel sheet. all searching, filtering, and sorting is
done with the SQL that i use to get the data into the ram
Look up Docmd.TransferSpreadheet. in help


Yes I get get from home to work walking, It would take two days, but
its possible. I'd much rather use a more modern form of transport,
like a Cable Modem!

My $0.02
GregK
<<Snip>>
 
Dave, none of that is anything to do with subforms.
well, subforms/bounded controls...
-----Original Message-----
Dave, none of that is anything to do with subforms.

To get the value of the field in the underlying recordset of a form, just
use: Me![TheFieldName] from within the form's code module. It is
irrelevant whether the form is running as a main form, or a subform.

I think you will find that there are few good reasons to avoid subforms.

HTH,
TC


yes its quite possible its just my lack of understanding
how it works

i never have figured out how exactly you get any data out
of a subform

is it even possible, for example, to get the ID of the
selected record?

what if i want all my combo boxes to start with the same 2
values, and then each list their own unique contents?
(a window i made recently has about 15 combo boxes that
start with '<All>' and '<not specefied>', and then list
their own unique contents)

indexing into an object list using ListIndex allows me to
obtain all data for the selected record. i can then pass
the ID of the record to a different form or control and
load information based on that ID. also since i have the
data in the RAM already, its easy as pie to pump it into
an excel sheet. all searching, filtering, and sorting is
done with the SQL that i use to get the data into the ram


.
 
Back
Top