Topics Search

Dynamically creating table using form

Dynamically creating table using form
Views: 11
I am trying to dynamically creating tables in Access 2010.
I would like to get the info from the user (Table name, number&type of columns)
and then creating the table using an SQL Query.

I know how to write the query, but I need help with passing the arguments to the query
Sponsored Links:

Similar posts...

 

Problem dynamically removing controls

Problem dynamically removing controls Icon
So now we've having tons of fun. edit, and remove records which relate to pedagogical items on a whim. There is no scenario where the number of these items will ever exceed 75.

These items are then used to create table columns on a separate table. This also means that the user entry form must be updated to reflect these fields.

Right now I'm able to pull the names and build the fields dynamically; however, I'm having a problem removing them:
 

Covering Microsoft Access 2007 and 2010

Covering Microsoft Access 2007 and 2010 Icon
- Brief overview of Relational Databases and Database Applications
- A Business Example
- Starting Microsoft Access
- Creating Table using Design View and Viewing Tables
- Viewing and Adding Data to a Table
- Creating Relationships Between tables
- Creating and Running Queries
- Single and Multiple Table Queries
- Creating and Running a Data Entry Form
- Creating a Single Table Form using the Wizard
- Review of Creating and Running a Data Entry Form
- Creating and Running a Report
- Creating a Single Table Report using the wizard
- Exercise: Creating a Single Table Report
- Review of Creating and Running a Report
- Creating and Running a Master/Detail Form
- Creating and Running a Switchboard
 

Subform showing same record x times

Subform showing same record x times Icon
I have a form which has a listbox containing my tables. From that, I can successfully select a table and click on a button. There is a sub-form that has a recordsource that is set to the selected table.

I am able to dynamically change the captions to the correct field names for the table and can successfully display data for the fields.

However, where a table has x records, I get x instances of the SAME record (the first on the table) rather than seeing x separate records. x happily changes according to the selected table.

I am displaying the data in a datasheet as the sub-form;am using Access 2007; it is an Access Project with a SQL Server 2008 back-end.

Here is the code fired by the button when the table has been chosen from the list box.
 

Logic. What is better to creat a form from? A table or a query?

Logic. What is better to creat a form from? A table or a query? Icon
I've seen responses to my and other people problems and I've noticed that the gurus will sometimes recommend creating a form based on a query.

Can someone explain why that would be more beneficial or prudent rather than creating a form directly from a table? Or, maybe I misunderstood and it doesn't really matter. Either way,
 

Bind an Access Form's Record Source from an XML File at Runtime

Bind an Access Form's Record Source from an XML File at Runtime Icon
Learn how to bind a form dynamically to a recordset created from an XML file. This simple application can be the starting point for a powerful solution for your customers and should be considered a part of your arsenal when developing Access application.
Dynamically setting the record source of a form is a handy way to make your forms more versatile. Likewise, programmatically importing an XML file to a table is a quick way to put that data to use. Combining the two operations hides a level of complexity from your users. This simple application is the starting point for an even more powerful solution for your customers and should be considered a part of your arsenal when developing Access application. (Access 2003)
 

Default form layout when creating new form

Default form layout when creating new form Icon
In the Northwind sample database there is a table called Customers. When I have the table hilighted in the navigation pane and selected CREATE then FORM I expect to create a new form with only customer details.

But rather the form displayed contains a split form including order details.

Where is this form coming from? Does access somehow look at the last form created that has this table as a data source? Is this an option that can be turned off? I'm assuming it's possibleto have several forms for the same table as a data source?
 

Have a form completely unbound and dont know how to link to table

Have a form completely unbound and dont know how to link to table Icon
I have created a form using the DesignWizard, but have not created it from a table. I basically made all of the text boxes, combo boxes, etc.

from the Control Wizard. I have spent a long time creating this form - and have used quite a bit of code to create pop-up calendars, hint text, etc. so starting over is really not an option.

I did not realise that creating an unbound form was going to be such a nightmare!

My problem is - I am obviously unable to create new records or save any input data as the form is not linked/bound to a table. I was told I would need to create headings in a table and link each individual text box, combo box etc.
 

using table as a look up field and adding to existing table

using table as a look up field and adding to existing table Icon
I want to use a 2nd table as a lookup field on my main table(permits) and have the chosen fields added to the permit table fields using a form. If I change the field to a lookup using the2nd table (contractors) how do I pull the additional fields into the form/1st table?

I also tried creating a new form w/fields from both tables after adding a relationship but the form will not allow me to add any new records. .
 

Dynamically Add fields/controls to reports

Dynamically Add fields/controls to reports Icon
I've not much experience with building reports in MsAccess. Can one dynamicall add fields/controls to reports from a vba module such as that linked to a form? I.e. do processing . . .set a sql string as a report's recordsource, then have the fields of the recordsource added or displayed in the report. I want to do this without having predefined the report content/format, etc.

Part of my reason for persuing this data display method is that there doesn't seem to be a grid control for displaying data on a form. So, how about a report that is built dynamically; can I do that?
 

Dynamically freezing columns in a datasheet view

Dynamically freezing columns in a datasheet view Icon
Does anyone know of a way to Dynamically Freeze columns on a Form in DataSheet View

[FieldToFreeze].SetFocus
DoCmd.RunCommand acCmdFreezeColumn

It seems strange that you can set the ColumnOrder, ColumnWidth and ColumnHidden properties of a DataSheet view along with other DataSheet properties,
but the Frozen Columns can only be set using a RunCommand.