N
najah via AccessMonster.com
I am really struggling with a database I'm constructing and its probably
because I'm a newbie. At this time I think I am burned out, so this dilemma
may appear trivial to you experts.
I have a mainform Timesheets and a subform TimesheetHours. This database
will be split with a BE copy on server and the Fe copies will be distributed
to the employees in order to enter their time. The supervisors will have
master copies having access to all employees forms and report, while the
employees will have access to only their info. Their is also a restriction
placed on the forms, where they cannot edit their timesheets after 30 days of
the initial date.
My problem
I've applied filters to the employees fe copies by way of using a query and a
VB onopen Do.Cmd, so when they go to the form(timesheet) to view or edit
their time they only see their data. In order to do this I made a copy of the
Timesheet form and changed the recordsource to match the query where the
criteria matched the employee's id and then renamed the Timesheet form
attaching their initials on the end. The problem occurs when I try to
implement the restriction code.
I did the coding this way
Main form:
If Date-[DateEntered]>30 then
Me.AllowEdits=False
Else
Me.AllowEdits=True
SubForm:
If Date-Forms!TimeSheet![DateEntered]>30 Then
Me.AllowEdits=False
Else
Me.AllowEdits=True
The filtering criteria is in the mainform(Timesheet) which is the Employeed
ID Field
When I apply the above code to the Subforms of each employees of course the
Form name changes to reference the filtered form i.e TimeSheetForDC. However
, the new reference overrides
the previous code for the subform(TimeSheetHours) therefore creating an error
when I try to open another form.
Sorry for the length and I hope I explained it well enough for someone to
give me a simple solution.
Help me please!!
because I'm a newbie. At this time I think I am burned out, so this dilemma
may appear trivial to you experts.
I have a mainform Timesheets and a subform TimesheetHours. This database
will be split with a BE copy on server and the Fe copies will be distributed
to the employees in order to enter their time. The supervisors will have
master copies having access to all employees forms and report, while the
employees will have access to only their info. Their is also a restriction
placed on the forms, where they cannot edit their timesheets after 30 days of
the initial date.
My problem
I've applied filters to the employees fe copies by way of using a query and a
VB onopen Do.Cmd, so when they go to the form(timesheet) to view or edit
their time they only see their data. In order to do this I made a copy of the
Timesheet form and changed the recordsource to match the query where the
criteria matched the employee's id and then renamed the Timesheet form
attaching their initials on the end. The problem occurs when I try to
implement the restriction code.
I did the coding this way
Main form:
If Date-[DateEntered]>30 then
Me.AllowEdits=False
Else
Me.AllowEdits=True
SubForm:
If Date-Forms!TimeSheet![DateEntered]>30 Then
Me.AllowEdits=False
Else
Me.AllowEdits=True
The filtering criteria is in the mainform(Timesheet) which is the Employeed
ID Field
When I apply the above code to the Subforms of each employees of course the
Form name changes to reference the filtered form i.e TimeSheetForDC. However
, the new reference overrides
the previous code for the subform(TimeSheetHours) therefore creating an error
when I try to open another form.
Sorry for the length and I hope I explained it well enough for someone to
give me a simple solution.
Help me please!!