cmd or query which creates multiple new records

G

Guest

I want users to be able to update multiple new records by clicking on a
button on a form. The form in question updates employee weekly hours worked
and as most employees work a standard week I would like the user to be able
to enter the calendar week and shift and and then all the std hours data is
updated (I have 300 emps)- they then only have to amend records of emps who
have worked overtime etc..

Any help would be appreciated!!
 
G

Guest

Hi Debra - if I am understanding you corrently you should be able to create
an Update Query, then create a 1 line macro which runs the query, and attach
the Macro to the button. Does this help? Have you created Update Queries and
Macros? Let us know if you need more help with perhaps a bit clearer
explaination. Yours - Dika
 
G

Guest

Hi Dika,
Thanks for your reply! I have used a couple of update queries which check a
box which locks all records and prevents the current record from being
changed (and this is run from the menu using a macro). The update queries I
have amend existing records - I was looking for some help with the design of
an update query to create new records for a date and shift which would be
entered by the user , the query would need to then update std working hours.
Can you help please?
Thanks!
Debra :)
 
G

Guest

Hi Debra - hmm - you wouldn't use an Update Query to add new records, it
would just update existing records. How many records are you creating for the
new date? What do you mean 'and shift' and what do you mean when you say you
want to add new records for the date and then the user would enter? Is it
just that when the user adds a new record there would be data in some of the
fields? Sorry I'm not usderstanding you - Dika
 
G

Guest

Hi Dika, Sorry I've not explained very well.... The records I want created
relate to the number of hours an employee has worked for a particular week,
e.g. for each emp there is the week end date, the shift they work on (3 shift
patterns) and the breakdown of the hours they have worked, basic hrs,
overtime, holiday hrs etc. We have 300 emps in the dbase, so I would like to
be able to enter the relevant date and shift (as paramters) and have some
function which would enter all basic hours for that shift and week, we could
then go in and amend any emps who were on holiday, worked O/T etc -(this
would save us time). I hope this explains.....
Thanks!
 
G

Guest

Sorry Debra - I'm with you now! Right - have you worked with macros or
coding? For various reasons I use Macros to do this kind of thing but I'm
sure it's easier to code it, but takes some time to learn (partly why I
haven't learned as I am retiring this August). But I digress. What I do when
automatically adding a new record is to create a Macro using the RunCommand
- RecordsGotoNew - to create a new record and then using SetValue to set the
fields to the defaults from the Employee records. The SetValue would look
something like this - [Forms]![Enter SitReps]![Date Added] on the first line
and [Forms]![START]![Report Date] on line 2. Hope this helps --- yrs Dika
 
G

Guest

Thanks for your help Dika, I've tried setting up the macro, but this still
only updates one record at a time, (unless I am doing something wrong? I am
also having trouble with the calendar week field - I need to enter this so
that all the basic hours data for every emp is logged against the correct
week).... I want to update multiple records somehow and enter parameters,
i.e. the specific calendar week and shift the emp works on. Sorry for being
a pain....
debra

Kernow Girl said:
Sorry Debra - I'm with you now! Right - have you worked with macros or
coding? For various reasons I use Macros to do this kind of thing but I'm
sure it's easier to code it, but takes some time to learn (partly why I
haven't learned as I am retiring this August). But I digress. What I do when
automatically adding a new record is to create a Macro using the RunCommand
- RecordsGotoNew - to create a new record and then using SetValue to set the
fields to the defaults from the Employee records. The SetValue would look
something like this - [Forms]![Enter SitReps]![Date Added] on the first line
and [Forms]![START]![Report Date] on line 2. Hope this helps --- yrs Dika



Debra said:
Hi Dika, Sorry I've not explained very well.... The records I want created
relate to the number of hours an employee has worked for a particular week,
e.g. for each emp there is the week end date, the shift they work on (3 shift
patterns) and the breakdown of the hours they have worked, basic hrs,
overtime, holiday hrs etc. We have 300 emps in the dbase, so I would like to
be able to enter the relevant date and shift (as paramters) and have some
function which would enter all basic hours for that shift and week, we could
then go in and amend any emps who were on holiday, worked O/T etc -(this
would save us time). I hope this explains.....
Thanks!
 
G

Guest

Hi Debra - what about
Add a new field to the Table, single digit is enough calling it FLAG or
something
Have your macro ---
add as many records as you need (use RunCommand - RecordsGotoNew) by
putting this on several lines of the Macro.
use the SetValue to set FLAG to a unique value.
then run an Update Query using FLAG to select by, making sure you clear
FLAG.

This can all be done from the Macro it would be something like this (for 3
records)

RunCommand
RecordsGotoNew
RunCommand
RecordsGotoNew
RunCommand
RecordsGotoNew
SetValue
FLAG = 1
OpenQuery
Name of query where selects FLAG = 1 and updates other fields
Are we getting there?

And trust me - you are not a pain. I wish I had learned about this group
when I first started so am always happy to help. It would have helped just to
get some ideas and try things out - and then work out your own ideas. And us
ladies have to stick together.

yrs - Dika
Debra said:
Thanks for your help Dika, I've tried setting up the macro, but this still
only updates one record at a time, (unless I am doing something wrong? I am
also having trouble with the calendar week field - I need to enter this so
that all the basic hours data for every emp is logged against the correct
week).... I want to update multiple records somehow and enter parameters,
i.e. the specific calendar week and shift the emp works on. Sorry for being
a pain....
debra

Kernow Girl said:
Sorry Debra - I'm with you now! Right - have you worked with macros or
coding? For various reasons I use Macros to do this kind of thing but I'm
sure it's easier to code it, but takes some time to learn (partly why I
haven't learned as I am retiring this August). But I digress. What I do when
automatically adding a new record is to create a Macro using the RunCommand
- RecordsGotoNew - to create a new record and then using SetValue to set the
fields to the defaults from the Employee records. The SetValue would look
something like this - [Forms]![Enter SitReps]![Date Added] on the first line
and [Forms]![START]![Report Date] on line 2. Hope this helps --- yrs Dika



Debra said:
Hi Dika, Sorry I've not explained very well.... The records I want created
relate to the number of hours an employee has worked for a particular week,
e.g. for each emp there is the week end date, the shift they work on (3 shift
patterns) and the breakdown of the hours they have worked, basic hrs,
overtime, holiday hrs etc. We have 300 emps in the dbase, so I would like to
be able to enter the relevant date and shift (as paramters) and have some
function which would enter all basic hours for that shift and week, we could
then go in and amend any emps who were on holiday, worked O/T etc -(this
would save us time). I hope this explains.....
Thanks!

:

Hi Debra - hmm - you wouldn't use an Update Query to add new records, it
would just update existing records. How many records are you creating for the
new date? What do you mean 'and shift' and what do you mean when you say you
want to add new records for the date and then the user would enter? Is it
just that when the user adds a new record there would be data in some of the
fields? Sorry I'm not usderstanding you - Dika


:

Hi Dika,
Thanks for your reply! I have used a couple of update queries which check a
box which locks all records and prevents the current record from being
changed (and this is run from the menu using a macro). The update queries I
have amend existing records - I was looking for some help with the design of
an update query to create new records for a date and shift which would be
entered by the user , the query would need to then update std working hours.
Can you help please?
Thanks!
Debra :)

:

Hi Debra - if I am understanding you corrently you should be able to create
an Update Query, then create a 1 line macro which runs the query, and attach
the Macro to the button. Does this help? Have you created Update Queries and
Macros? Let us know if you need more help with perhaps a bit clearer
explaination. Yours - Dika

:

I want users to be able to update multiple new records by clicking on a
button on a form. The form in question updates employee weekly hours worked
and as most employees work a standard week I would like the user to be able
to enter the calendar week and shift and and then all the std hours data is
updated (I have 300 emps)- they then only have to amend records of emps who
have worked overtime etc..

Any help would be appreciated!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top