Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create control for each item in table

Status
Not open for further replies.

northernbeaver

Programmer
Jul 9, 2001
164
CA
I have a form that I almost need a grid or excell style data entry. its a form to enter employee hours against work stations. (how many hours on this date did this employee work at this station) to make it easy for users to enter an employees time sheet what would be ideal is all stations would be listed accross the top of the form and a box to record how many hours for each one under it. heres the real kicker.....the stations are not stationary. they change and can be added or deleted so the boxes cant be stationary or hard coded. the type of solution Im thinking about but cant figure out how to do is this: on form load, grab all the active stations and create a field for each one. then create an hours field for each one. upon pressing the save button (there would have to be a save button) a record would be created in the table for each hours box that has been entered so it can be called up in a report......am I making any sence? is something like this beyond access or do I just have to learn how to do this? can you create a form on the fly and does anyone know what the pitfalls are?
 
where would you get the list of stations from???

My idea would be to have a single line. You get the list of stations from a table, which can be added to if needed. This table is linked to another one, where you can store the ID of the station along with the user id, and the hours value.

Then you create a simple input form using 3 fields, User Name, Station, and Hours.

The Username and Station are combo boxes, and the hours one is a number fields. Once a line has been completed, then they can enter another one underneath that.

Does that sound like what you are after
 
Yes the list of stations comes from a table.

what im looking for is a more user friendly way to enter an entire days worth of information for an employee. right now there are 6 workstations and 40 employees and timesheets are handed in at the end of each week. so to enter all the employees information the way you described would be to fill out the form 6 times for each 40 employees for each 7 days (6X40X7)that is 1680 times to fill out the form. its a slight shift in thinking but I would like all stations to be on one form so its only fill out one form with 6 fields for each employee 40 for all 7 days (40X7). I realize it sounds like 6 of one and half a dozen of the other but the way Im thinking is to reduce the possibility of the user missing an entry on this form. did I explain it any better? its the creating the 6 stations on one form is the part thats getting me as 6 could change and so would the form. thats why I want to somehow come up with a more dynamic way of creating the form
 
Not knowing how you've named the fields why not create a table with the workstations, that can be changed and altered, also include a field that would provide the name of the field in your main table to be updated when an entry is made against this workstation. Then create a form with more textboxes and labels than you currently have (set their visible property to False), use the form's on open event to query the table with the Workstations and set the values of the labels to the Workstation Name, and set the ControlSource of the textboxes to the other field in that table and set the visible propety to True.... Or something along this line.

PaulF

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top