Auto insert data into table

  • Thread starter Thread starter Steven Phillips via AccessMonster.com
  • Start date Start date
S

Steven Phillips via AccessMonster.com

I have a column for machine number which is a drop down combo for 50 or so
different machines. I have another column for available hrs. I need to
automatically input 24 hrs into available hrs column for each machine each
day of the month excluding holidays. One problem I have is each machine may
several inputs in any one day so I don't want to exceed the 24 hr input.
 
Steven

You described columns, and your subject line spoke to inserting data in a
table, but you posted in a "forms" newsgroup. Where are you trying to do
this "insert"?

More info, please...

Jeff Boyce
<Access MVP>
 
Jeff,
Sorry for the confusion. I enter the data in a form which feeds a table.
The table has the column available hours, as well as date, machine#, etc.

Steve
 
Steven

Glad to hear you are working in a form. That make this easier. Your form
has a multitude of events you could consider using to do the kind of
validation you described.

One approach would be to use the BeforeUpdate event of the control with the
"hours" in it, and use something like DSum() to inspect the "total-so-far",
adjusting the value in the control THIS time to 24 minus what ever total's
been used. If the amount ends up negative, cancel the update and set it to
the amount remaining.

Good luck

Jeff Boyce
<Access MVP>
 
Jeff,
I have thought this out and have a clearer solution. I want to auto-
insert the available hrs. based on another table which declares the hrs
available for each machine. This may be 24, 0r 22.5, etc. I need this to
happen for each machine, each day regardless if any data is entered towards
that machine.
Make sense?

Thanks, Steve
 
Steven

I must have misunderstood. I thought that you had stated that a machine
could not be "signed out" for more than its available hours.

Or are you saying that you are going to build a starting point by keeping a
table that shows total available hours per machine, and "draw down" from
that point?

Jeff Boyce
<Access MVP>
 
Jeff,
Thanks for the help. I have decided to go another route and force an input
in this column. They need to be aware of the data anyway and there's to
much room for bad data here. I have posted a date query question if you
have some time!

Thanks again,
Steve
 
Back
Top