user defined custom fields - approach?

  • Thread starter Thread starter Mark Andrews
  • Start date Start date
M

Mark Andrews

I'm working on an Access application that I would like to have the ability
for users of the application to add custom fields to store extra data.

Example: the application tracks customer data and the user might want to add
a few extra fields for data not being tracked by the application.

I'm wondering what the best approach should be and if anyone has any code
they have used before?

I would like to allow custom fields of type
- text (ability to limit length)
- number (some formatting options)
- currency (some formatting options)
- date (form would use calendar etc...)
- list (would use a dropdown of user-supplied choices)

Please do not answer to just have the user use Access and modify the
tables/forms etc... Users will not be able to get into the tables/forms.

I'm looking mostly for guidance on the best data structures to use and
general approach.

Thanks in advance for any guidance,
Mark
 
Please do not answer to just have the user use Access and modify the
tables/forms etc... Users will not be able to get into the tables/forms.

Hrm.

So you want users to be able to add any arbitrary number of fields and
controls, in tables, on forms, on reports; without restrictions; without the
user being able to use any design tools; and without any intervention on your
part?

Ouch.

It sounds like you really want to be able to replicate the design interface
yourself! A rather tall order!

About all I can suggest is that you have some basic set of unused fields, two
or three of each datatype, in your tables; have textboxes or other appropriate
controls on your forms and repofts, with their Visible property set to no, and
write code to bring those controls into visibility on demand.
 
John,

I would restrict the user to a fairly simple interface to setup custom
fields and on the forms they display on they would show up at the bottom of
the form.
Also I would set a limit of maybe 5 custom fields.
I don't think it's too tall of an order?, but one I would love to borrow
some code from someone who already tackled the issue.

I looked at some other applications written in either visual basic or .net
and it looks like they actually change the tables
to add the fields based on how the user decides to add the custom fields?
Is that a better way to go?
Example: user sets up a text field length 30 named "product id" and the
table gets altered to add the new field
ditto for double and datetime field etc... I don't usually run code to
alter tables in Access (I assume you can do this)?

On the forms I could have 5 textbox controls and 5 dropdown controls that I
make visible as needed and set the control source in code.
I didn't think it was possible to create controls at run-time in Access?

I was hoping to find someone who wrote something similar and borrow some
code for the "how the user defines the custom fields".

It is actually a fairly common feature found in "off the shelf software".
Hoping someone out there already went down this road.

Any other help from anyone is appreciated,
Mark
 
Back
Top