Related Topics

Create Form Dynamically

how to create unbound text-fields dynamically
How to create text-fields dynamically in a form using a VBA script.

my problem is: I have to create a multi dimensional control array (textfeilds) in a form to collect data and save it to a table, I tried several methods to create text-fields but couldn't make it.


Customisation of dynamically populated forms
I have a series of forms and subforms which cascade to dynamically create a checklist form of certain questions and answers dependant on the choices selected by the user.

This works by dynamically populating the form with whatever questions are required from the relevant tables

The check-list actually works quite well however I can only get the form to display 1 question at a time in single form view or all questions at a time for continuous form view. I do not want to use datasheet view

So therefore is there more customisation I can do with continuous view in code to show a certain number of questions per page for example, I don't like the scroll options I want to do everything with command buttons?


Customisation of dynamically populated forms
I have a series of forms and subforms which cascade to dynamically create a checklist form of certain questions and answers dependant on the choices selected by the user.

This works by dynamically populating the form with whatever questions are required from the relevant tables

The check-list actually works quite well however I can only get the form to display 1 question at a time in single form view or questions at a time for continuous form view. I do not want to use datasheet view

So therefore is there more customisation I can do with continuous view in code to show a certain number of questions per page for example, I don't like the scroll options I want to do everything with command buttons?


Problem dynamically removing controls
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:


Dynamically creating table using form
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


Trying to use a macro to load a form dynamically
Windows Vista
Access 2007

This is my first post here and I need a little help. I'm trying to load a form dynamically and it doesn't seem to be working. I'm using the OpenForm macro and in the "Where condition" field I'm using '[Forms]![toddler_times]![student_id]=[Forms]![bathroom_chart]![bt_student_id]'. When the form loads it doesn't load any of the corresponding records (and yes there are records in the table


Is there a way to prevent a form from updating its content dynamically?
I was wondering if anyone knew of any way to prevent a form from updating its content against the tables dynamically?

I have some subroutines that check what values the fields have, and deactivates some of the fields based on the values.
(Every field that is not "0" is deactivated with on current).

The problem is that when two or more users are using the database, and one of them changes one of the fields, this changes suddenly appears in the other users' form as well.
This as I huge problem, as the fields doesn't get deactivated when the data appears in this way.

I would really need some way to prevent this from happening, so that the only time the form would update its info is when the record is changed or manually updated


Hiding code
I have created specific functions (Public () as.) whose code is stored in table fields. When some of these specific functions are needed, I read the table content,dynamically create a new module, put the function code within, make an Eval() to get a result, and erase the dynamically created module.

My problem is that the VBA editor window is launched. Is there a way to prevent its display (by code or something else)?


Dynamically pass parameter from form to report
I'm working with Access 2010 and converted my Access project to an ADP file. In order for me to write a report which can accept a parameter I need to write a stored procedure - which I've done.

I've got a form with a command button to open the report, but my problem is that I would like the command button to dynamically pick up the active record id (record id currently displayed on the form) and pass that through to the report as a parameter instead of the report prompting me for the record id parameter.


Load Subforms Dynamically
Subforms are one of the great features of Microsoft Access. If you have ever tried to replicate the Form/Subform paradigm of Access in Visual Basic, you will appreciate how simple the process really is.
1. Create the master form
2. Create the child form
3. Drag child form and drop on master form
4. Set the Link Master Field and Link Child Field properties


Display web content on a form.
Is there a way to get web content to be displayed on a form. I have a form, and on it I would like to have the weather.

I only want to be able to display the web table that holds the 5 day forecast along with the graphics. What kind of object do I need to create on the form to hold the content and how would I go about retrieving it? Obviously it would need to update dynamically.


Dynamically freezing columns in a datasheet view
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.


CreateReportControl() won't write to header section
I have an Access 2007 report with a custom header section named SSNHeader. The SSNHeader has preset labels, textboxes, and a chart in it. I want to dynamically add labels and textboxes to the SSNHeader depending on input from a form. I'm using the following code to create the first textbox. But the control is always written to the Detail section. The SSNHeader is not recognized for some reason. I need the control to be placed in the SSNHeader section.

DoCmd.OpenReport "Hidden_Paycheckv2", acViewDesign

' *** Dynamically create report controls ***
Dim txt401k As Control
Set txt401k = CreateReportControl("hidden_paycheckv2", acTextBox, SSNHeader, "", ER_401k


Dynamically Add fields/controls to reports
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?


Hiding code
I am working an a complex database.

I have created specific functions (Public <function name>() as.) whose code is stored in table fields. When some of these specific functions are needed, I read the table content, dynamically create a new module, put the function code within, make an Eval(<function name>) to get a result, and erase the dynamically created module.

My problem is that the VBA editor window is launched. Is there a way to prevent its display (by code or something else


Hiding Code
I am working an a complex database.

I have created specific functions (Public <function name>() as.) whose code is stored in table fields. When some of these specific functions are needed, I read the table content, dynamically create a new module, put the function code within, make an Eval(<function name>) to get a result, and erase the dynamically created module.

My problem is that the VBA editor window is launched. Is there a way to prevent its display (by code or something else


Dynamically size report object
In Access 2003/XP/2000/97, I've created a report. In this report, I have a text box object that could return a value that has a small number of characters or it could have a large value in it. I don't want to create the text box object too big on the report in case the value that it returns is very small. It would look silly to have all of the blank lines. Is there a way that I can dynamically size this text box?


Copying an existing form
I'm trying to copy an existing form in the same database with a different name. For example, I'm copying the form "Aggregate" to a new name "Aggregate2"

I'm trying to do create the name of the new form dynamically, but checking to see if the form exists and then incrementing the number. I have done this and it works, but I get a typemismatch error when I try to copy the form.


Form Controls - dynamically creating
I have a form which I want to contain a list of people's names and for each person there are a set of textboxes which link to a querys in the background to show a drop down list.

On form load a query triggers to give me the current list of people and only that number of controls appears on the form. This is currently controlled through the textbox .visible = true property.

This is a very tedious method, and it would be limited to the number that I create on the form. I can't tell how many people are going to be returned on the query!

Is there a way I can create an array of textboxes on the fly and be able to reference them?

I hope I am explaining this properly :-)


Referencing an element from an instance of a form.
I've used Allen Brown's advice on how to create multiple instances of a form (can't post a link as have too few posts, but a quick google will reveal the page I'm talking about), and it's working great.

Now I need to reference an element on the form, but on an instance of the form, not the original form itself.

Each instance of the form is named dynamically when it's created; it takes its name from a field called Company.

How can I reference an element (called NewKC) of the form from a query