adding field using form

saadtanvir93

New member
Local time
Today, 17:13
Joined
Sep 27, 2018
Messages
5
can someone tell me that
if i could add a new field in my existing database using a split form
 
ok i have an existing database table and i am making a software in access using forms
my requirnment is to add a new field in the database while the software is running
eg if i click a buttton in the split form it create an empty field in my database table.
 
Screenshot (50).jpg




in here i want a button which when pressed creates a new field which includes cheakbox in it
 
Looking at your form, you have a spreadsheet design with lots of similarly named fields Modification 1, Modification 2, Reference 1, Reference 2 etc.
This is not appropriate for a database and indicates the need for a fundamental table redesign.
So whilst it is possible to write code which will add fields to a table, I suspect that is going to add to the design issues you already have.
 
..
my requirnment is to add a new field in the database while the software is running
..
You can, but why?
The below code add a field with the name YourFieldName to the table YourTableName, the fieldtype is number.
Code:
CurrentDb.Execute "ALTER TABLE YourTableName ADD COLUMN YourFieldName Number;"
 
I'm not going to equivocate.

Adding columns to a table/form/report on the fly is just plain wrong. It is important that you stop where you are, stand back and rethink the design so that it uses relational database design techniques. You are going to be extremely unhappy working with Access if you make tables that look like spreadsheets.

We can help you with the redesign. The sooner you start, the fewer things you will ultimately have to change and the less work it will take.
 

Users who are viewing this thread

Back
Top Bottom