I need a grid that allows columns to be added to the right? Ideas?

  • Thread starter Thread starter aybs
  • Start date Start date
A

aybs

Hi. I am making a form for data entry. Basically, I need the ability for my
users to add new columns to right (not bottom) as they require. For example,
the headings are all dates and I need to be able to add the new date, and
then the data in that column.

I've played with the datasheet form view before - it not too bad, but I
can't change headings on the fly.

I'm like the solution to work in Access 97. Cheers.

Any suggestions?
 
Such a design goal is not workable in ms-access.

The problem is if you add a new column, then all of the other reports, data
input forms, and even your processing code will have to be changed. While
you might now just have one report, in a few years as you develop this
application, you likely will have many data entry forms, many code routines
that process data, and many reports that report on data.

If you add just one column, or field to your table, then virtually ALL OF
the above things like code, reports etc will have to be modified. You can
imagine a large complex accounting system. Adding just one field would
require huge amounts of the application to be re-written, as each part of
the application would be need to be come aware of the new field. It is like
building a building, and then chaining your mind as to how the building
should be built. Trying to change something already built is EXTREMITY
difficult, and this also applies to data tables in a software package.

Worse, as eventually the database gets so un-manageable, you will be fired
for incompetence and loose your job since you will spend all your time
re-design parts of the application, and get no work done!. We don't really
want that! ;-)

So, I will suggest you do some reading on what is called data modeling, or
data normalizing. If a product like quicken accounting can satisfy millions
of businesses around the world and NEVER NEED a new column added for each
different company, then you too can come up with a solution that does not
require the addition of new columns. Adding new columns/fields to a
application is extremely expensive from a developers/programmer time. And, I
sure you know how expense developers are these days. However, adding new
records is very cheap from a application point of view.

So, it is not practical to add new columns to an application, as reports and
all kinds of things will need to be modified to work with the new column You
need to come up with a design where the columns and data structure is STABLE
and NOT changing. It is common to add new columns with a spreadsheet, but
this is deadly mistake when working with a database. A database system is
NOT a spreadsheet, and the same spreadsheet approach to problem solving will
NOT work.

The reason why you cannot easily find a grid control, or something that lets
you easily add new columns for data entry is because no one works that way,
and thus your quest to find such a setup is going to be very hard indeed. We
don't develop software that way, and it don't work.

It is possible that you just need to show/hide some existing columns during
data entry, and that is certainly a different problem. Usually, just adding
few extra text boxes in a continuous form will do the trick. You can either
show/hide those additional columns, or simply set the data source of the
text box at run time. However, you certainly do NOT want to add additional
columns to your table designs (and, to be fair, perhaps you were/are NOT
suggesting/asking how to add additional columns to tables, but just for
display purpose). So, if you just need to hide/display a few extra columns,
then that is not a big deal, and very easy. Adding new columns to data
structure is VERY HARD.

Here is some reading on data normaling, which does eliminate the need to add
columns in a application:

ACC2002: Database Normalization Basics
http://support.microsoft.com/?id=283878

Database Normalization Tips by Luke Chung
http://www.fmsinc.com/tpapers/genaccess/databasenorm.html

Data Normalization Fundamentals by Luke Chung
http://www.fmsinc.com/tpapers/datanorm/index.html

324613 - Support WebCast: Database Normalization Basics
http://support.microsoft.com/?id=324613
 
Hi - thanks for your response and I appreciate the time you spent
responding. I see that I wasn't clear enough in my original posting now. Let
me give some more details now.

Trust me, I know normalization inside out and this problem has nothing to do
with adding columns to tables. I'm just talking about user interface here.
The gist of this problem is that just because data is stored normalized, our
users shouldn't be forced to work with their data in this way. Imagine the
below data in a table (sorry if the spacing doesn't work quite right)

Location Date Value
loc1 Jan 1/04 3
loc1 Jan 2/04 4
loc2 Jan 1/04 5
loc3 Jan 1/04 3

-----------------------------------------
But when this data is entered, I need the layout something like this.

Jan 1/04 Jan 2/04 ---> dates and values added as required
loc1 3 4
loc2 5
loc3 3

Now please remember the above is just a simple example. Now, I now I can use
the existing controls in Access to similuate this. But I can imagine a
better control is already built somewhere for doing just this. In this
control I would have lots of control over the appearance of the grid,
especially the top row and left column. Perhaps a calender is built right in
and accessible when necessary. Probably highlighting on the active cell as
well.

I am curious as to what solutions others have come up with.
 
Hi,

Access does not allow you to add controls dynamically at runtime.
If you know the maximum number of columns required, you could design the
form with all of them (aligned on a row, and make the form to work as
continuous form), and show / hide them as appropriate, to show only as many
columns you need.

A more flexible approach will be to use an ActiveX grid control, or MS
ListView control, in Report mode (which actually is the same control MS uses
in Windows Explorer, in right pane, and report mode is when you select
Details). It can also store data, so you can set / retrieve it.

Another approach might be with MS Grid or MS FlexGrid control

HTH,
Bogdan Zamfir
___________________________

Independent consultant
 
Back
Top