Variable length forms

JRG0620

Registered User.
Local time
Today, 03:22
Joined
Nov 23, 2008
Messages
20
I need to be able to display 1 to N records from a table as well as add/update them to the same table. Here’s my story. I have a table. The key is Project and Building. The attributes are several (10) different percentages.

The user wants to be able to enter the Project number and display all the Buildings associated to that Project. There can be 0 records or there can be X records. There is no limit to the number of Buildings for a Project. The user wants to be able to update, delete or add Buildings to the Project. They also do not want the database updated until they click an ‘Update’ button therefore, I cannot bind the table to the form, I think. Can anyone point me in the right direction on how I would even begin defining a form that will grow depending on how many records are in the result set and how I would process the records once the ‘update’ button is clicked. Thanks for any help.
 
Records dont grow (per se). Your best bet here is a form that will, by default, be set to a continuous form type display. Other than that, the rest of the info you gave is hard to follow, so personally that is all i have for you. Perhaps someone else here has more as well...
 
Adam, Thanks. What I meant by 'grow' is that there can be 0 records in the table for that specific Project or there can be 50+ records for that Project. The record count grows not the record attributes. I thought about a continuous form but without the form being bound to the table, how are the form fields built. I cannot pre-define the form so how are the table records moved to the form. Thanks

-Joe
 
you're gonna have to bind the form to the table, at least dynamically with code. that's the purpose of a form anyway. nobody realizes this per se, but a form is nothing more than a table or a query, with a different LOOK. if they weren't, there would be no use for forms.

as for helping some more, I think i'd have to see one of your samples (stripped?) to get a handle of what you're talking about doing...
 
Unbound forms for data entry, in Access, is a real waste of development time and resources, and does away with one of the main advantages in using Access. You really should be using bound forms. You can place code in the Form_BeforeUpdate event asking if the user wants to save the current record and act accordingly.

The statement "...they also do not want the database updated until they click an ‘Update’ button" sounds as if they want to enter multiple records and then save them or dump them, and this cannot easily be done with an unbound form. An unbound form never actually has a 'record,' it only holds the data that can be written to a table for one record. In other words, you cannot enter data for several records into an unbound form and then save them.
 
are you following me, Linq? ;)

If you're trying to, try following THIS: LINQ!

nothing wrong with a little humor, EH? :)
 
Misinglinq, thanks for the reply. I guess I don't know enough about MSAccess to be able to do what the user wants when the table is bound to the form. I'm finding it easier but yet more time consuming to actually write the VB code. For example:

Bldg Pct1 Pct2 Pct3 Pct4 Pct5 are the attributes in my table.

If the table is bound to the form, what would be the process so that when the Bldg is entered, a validation routine is called to ensure the Bldg entered exists on the master Bldg table. (Would this be a Dlookup placed on the 'On Exit' event? )

Also, the user wants a running total of the percentages so that they can see when the total hits 100%.

I've tried entering code on the 'On Exit' event but it does not seem to work.

It's pretty obvious I don't know all the ins-and-outs of MSAccess. Thanks for any advise.

- Joe
 
Let’s see if I can explain my issue in more detail. I have a form bound to a table. The table has a primary key of Project and Bldg.
The table has the following fields:

Project Bldg GenCon% SitePrep% Roof% HVAC% Plumb%

The user enters the Project Number and all associated Bldg information is displayed on the continuous form. There can be zero records for the Project or there can be many. There is no limit to the number of records for the Project.

On the form, I have added a BldgTot%. This field is not on the table and it is supposed to be calculated as the user enters the percentages. The BldgTot% has a formula of BldgTot% + GenCon% + SitePrep% + Roof% + HVAC% + Plumb%

I have two issues.
1) The BldgTot% is not calculated until I am off the current record.
2) The BldgTot% for record two inherits the total from record 1 until I’m off of record 2.

How do I calculate the BldgTot% as I’m going from one percentage to another? I’ve tried entering the formula on, the field event ‘on exit’, ‘on change’, ‘on update’.
How do I keep the BldgTot% to the specific records information instead of to a complete total?

Thanks for any advise/direction.
 

Users who are viewing this thread

Back
Top Bottom