Curt,
Ok, so no other data to be recorded, just the call times for each desk,
right?
Well, let's clear up one thing first. You absolutely shouldn't have a
separate field for each desk. This is the type of thing that you
sometimes see done in those s-things. In a database, it is called
various things, among them the "fields as data trap", otherwise known as
"wrong". I would recommend you change your table design to 2 fields,
being Desk (Number data type) and CallTime (Date/Time data type). All
the call times are recorded in one field, and the desk identified in the
other. Among other things, this will considerably simplify your later
need to do your totals and statistical analysis of the figures.
If you use your existing plan, and if you use macros rather than VBA
procedure, you will need a separate macro and a separate query for each
command button. I would not do it like this. I would have one command
button on the form. And I would put an unbound Option Group on the
form, with 4 option buttons, where the operator will select which Desk
at the beginning of the call logging session. Then, you can make a
query like this...
Select 'New' Query, and click 'Ok' for design view. Close the 'Show
Tables' dialog without doing anything with it. In the Field row of the
first column of the query design grid, enter the equivalent of...
[Forms]![NameOfYourForm]![NameOfOptionGroup]
In the second column, enter like this...
Now()
From the Query menu, select Append Query, and nominate your call
logging table. In the 'Append To' row of the grid, in the first column
select your Desk field, and in the second, select the CallTime field.
Close, name, and save the query.
Ok, now make a macro, with the OpenQuery action, and nominate this query
that you have just made. Assign this macro on the On Click event
property of the command button on your form. All done. Except that
after you have got it working properly, you might want to insert a
SetWarnings/No action in the macro before the OpenQuery, to suppress the
display of the action query confirmation prompt.
--
Steve Schapel, Microsoft Access MVP
Steve, What I am trying to do is make a call log that records the date & time
any time one of the command buttons are clicked. I have 4 command buttons
(one for each desk), and every time a call comes in I just need them to click
the appropriate button and the date and time will be added to a table. In
that table I would like to have four columns (one for each desk) that stores
the the date & time every time the button was clicked.
Then I was going to have another way to count the total number of calls for
each desk and the totals for all combined.
Thanks for the help Steve, this spreadsheetist needs it. lol