Dear All,
I have a problem with my attempt to create a time recording program.
I have 2 tables:
Employees
Times
Fields within Employees:
Fields within Times:
I have then created a query from the both tables above called:
TimeRecording
It has all the above fields in it.
Within the TimeRecording Query the Tables are linked as follows:
Employee is linked to Times via Employee ID, as a Number 2 join(Include ALL records from Employees and only those from Times where joined fields are equal)
I have now created a form TimeRecording
It is linked to the query TimeRecording
I put in some test data and it displays.
I have created a find button to find the relevant employee.
I have now also created a Time In/Out button
It has the following code behind it.
It gives me the following error message.
Any help would be greatly appreciated!
The form TimeRecording has the following text boxes:
I want the button to write into the text boxes within the form and save them.
Will this also then save it in the table??
I am quite new to this, is my approach to this problem right?
Again any help will be massively appreciated!
Thank you,
Kind regards
Triacona
I have a problem with my attempt to create a time recording program.
I have 2 tables:
Employees
Times
Fields within Employees:
Code:
EmployeeID - Number
FirstName - Text
LastName - Text
TelephoneNumber - Number
Code:
EmployeeID - Number
TimeInMorning - Date/Time
TimeOutLunch - Date/Time
TimeInLunch - Date/Time
TimeOutEvening - Date/Time
Date - Date/Time {Has default value of NOW()}
TimeDoneMorning - Date/Time
Lunch - Date/Time
TimeDoneEvening - Date/Time
I have then created a query from the both tables above called:
TimeRecording
It has all the above fields in it.
Within the TimeRecording Query the Tables are linked as follows:
Employee is linked to Times via Employee ID, as a Number 2 join(Include ALL records from Employees and only those from Times where joined fields are equal)
I have now created a form TimeRecording
It is linked to the query TimeRecording
I put in some test data and it displays.
I have created a find button to find the relevant employee.
I have now also created a Time In/Out button
It has the following code behind it.
Code:
Private Sub TimeInOut_Click()
On Error GoTo Err_TimeInOut_Click
If TimeInMorning Is Not Null Then
TimeInMorning = Now()
Else
If TimeOutLunch Is Not Null And TimeOutLunch > TimeInMorning Then
TimeOutLunch = Now()
Else
If TimeInLunch Is Not Null And TimeInLunch > TimeOutLunch Then
TimeInLunch = Now()
Else
If TimeOutEvening Is Not Null And TimeOutEvening > TimeOutLunch Then
TimeOutEvening = Now()
End If
End If
End If
End If
Exit_TimeInOut_Click:
Exit Sub
Err_TimeInOut_Click:
MsgBox Err.Description
Resume Exit_TimeInOut_Click
End Sub
It gives me the following error message.
Error Message said:Object required
Any help would be greatly appreciated!
The form TimeRecording has the following text boxes:
Code:
EmployeeID
FirstName
LastName
TelephoneNumber
TimeInMorning
TimeOutLunch
TimeInLunch
TimeOutEvening
Date
Will this also then save it in the table??
I am quite new to this, is my approach to this problem right?
Again any help will be massively appreciated!
Thank you,
Kind regards
Triacona