Advice needed

mark_jarman1

Registered User.
Local time
Today, 11:32
Joined
May 8, 2004
Messages
10
Right i have a table called "Clock In" and another table called "Clock Out" i wish to have a button on a form so that when it is pressed it clears/deletes all the records in them tables. How can this be done?

i tried using this code but it didnt work
Code:
    Dim strSQL As String
             strSQL = "DELETE FROM Clock In"
             DoCmd.RunSQL strSQL
             strSQL = "DELETE FROM Clock Out"
             DoCmd.RunSQL strSQL

Cheers

Mark :D
 
Why do you have a table for clock in an clock out - that's not natural?
 
Mark,

I would use more of a action query (delete query) to delete all records (or qualifying records)in the underlying table, and then tie the command button to run the query. However, I would be sure to include some message box options in the underlying code on the command button, maybe even requiring a password to delete. But your first step would be to set up the action query that when run will delete the required records, then put some checks and balances into the command button.

Good Luck
 
JACKSON said:
But your first step would be to set up the action query that when run will delete the required records, then put some checks and balances into the command button.

I'd say that the first step was to get a proper table structure.
 
Mile
Your probably right, but not knwing exactly what his table structure is or what he is looking to accomplish, I just figured I answer his question. By the way, Thanks for your help in the past on many issues, I think this site is really a high quality access forum.
 
JACKSON said:
Mile
Your probably right, but not knwing exactly what his table structure is or what he is looking to accomplish, I just figured I answer his question.

Well, we know he has two tables: one for clocking in and one for clocking out.
I don't see why you'd want to delete historical attendance data and I don't see why you should have to.

Something along these lines is the way I'd go:

tblEmployees
EmployeeID
Forename
Surname

tblShifts
ShiftID
SetStart
SetEnd
ActualStart
ActualEnd

tblEmployeesToShifts
EmployeeID
ShiftID


By the way, Thanks for your help in the past on many issues, I think this site is really a high quality access forum.

No probs. It certainly is a high quality forum.
 

Users who are viewing this thread

Back
Top Bottom