Question : Dynamic? form fields

Hello Experts,

     I have a form that is bound to a table with some text boxes and combo boxes that display data from a seperate table.  With this form it is uknown how many could be made in it on any given day.

     What im looking to do is when the form is first opened there is only one set of the blank entry forms and then as data is being entered into those a new set of blank entry fields will be created right below the previous ones.

     Hope this all makes sense and that this is possible.  Thank you in advance for any help provided.

Brandon

Answer : Dynamic? form fields

<>

Not a problem at all. I'll just step back and explain a few things.

<>

"Binding" means setting a form, report, or control's RecordSource property to a data source. In the case of a form, this can be a table or a query.

When you do that, fields in the underlying data source are available to use.

Access has a couple of basic ways of displaying data from a table or query:

1. Looking at a table or query directly - This gives you no real control over anything, it just displays the data. The view you get is a datasheet view. If your developing an application to be used by others, you'd never want to use this method.

2. Use a form - With a form, you get a lot more control over the data. A form can display data in three different formats:

A. Datasheet view - Only really useful for displaying read-only data in a grid type format as there is no control over the formatting of the data.

B. Single form - The form shows only one record at a time. Here you have total control in choosing where and how the data is displayed (you dictate the types of controls used and where they are).

C. Continuous form - Records are shown one after the other. You don't have as much control over the formatting as you do with a single form in terms of placement, but you can use different types of controls for the fields unlike with a datasheet. The new record is shown at the bottom of the form.

The last sounds like what you want.

My suggestion would be to take one of your tables that has a few records in it, create a new form, and then switch views. Try single, continuous, and datasheet views and you'll see the differences.

There is also something called a main/subform combination. This is where you have a "main form" and then a "subform" embedded in it. A good example of that type of a setup is where you have customers and their orders.

The main form would be in single form view showing a single customer, and the subform would be used to display their orders. Since they might have many orders, you would use a subform in continuous form view.

Another great way to see different types of forms is to create a new DB using one of the built-in templates. That gives you a ready made app that you can play with.

JimD.

Random Solutions  
 
programming4us programming4us