How to implement a 'timesheet'? (Form/Subform filter problems)

F

Farlie A

Hi.

So far it's taken a while to try and resolve what should otherwise
be a fairly simple task in Acess 2000

As part of a system I am developing, There was the need for an
'electronic'
timesheet function as part of the system.

However, despite setting up the Timesheet function as two linked
tables,
a main from for the time sheet and sub-form for the indvidual time
sheet
entires I can't at present seem to get the two link up properly.

The problem is that when I try to set the filter for the sub form from
the main
form, Access complains about being 'Unable to assign value to object'.
Having checked my code I can't find any typing errors and I have also
checked SEVERAL times that the fields I am trying to refer to in the
filter actually exist (and that the filter makes sense logically)

I am therefore asking if anyone here has example code in respect of an
elctronic timesheet function (tables/forms) implemented in Access 2000
that DOES work, so that I can determine where I am going wrong by
comparison of code.

Various iusses/functionality needed (suggestion on how to implement
welcomed)

- Checking for a timesheet for the current user/week or project/week
and creating it if it does not exist.

- Ensuring that only the relevant timesheet entries are shown in the
sub form - I've tried to use a filter (but as explained above Access
2000
doesn't apparently like setting the filter for the subform)

- Ensuring that there are no blank entries in respect of timesheet
entries.

Thanks in Advance

Alex
 
J

John Vinson

- Ensuring that only the relevant timesheet entries are shown in the
sub form - I've tried to use a filter (but as explained above Access
2000
doesn't apparently like setting the filter for the subform)

It sounds like you may be trying too hard.

It is NOT necessary to use VBA code, nor to set the Filter property of
a subform, typically!

You don't say how your tables are structured, but I'd suggest that you
look at the Master and Child Link Field properties of the Subform
control. They should contain the fieldnames of the fields which
provide the link between the mainform's recordsource table and the
subform's recordsource. For instance, if the Primary Key of the
mainform table is the date (and I don't know if that is the case), you
would use that field as the master/child link.

What are in fact the Recordsources of the main and subforms? What are
the master and child link fields? Could you perhaps post your code?

John W. Vinson[MVP]
 
F

Farlie A

John said:
It sounds like you may be trying too hard.

It is NOT necessary to use VBA code, nor to set the Filter property of
a subform, typically!

You don't say how your tables are structured, but I'd suggest that you
look at the Master and Child Link Field properties of the Subform
control. They should contain the fieldnames of the fields which
provide the link between the mainform's recordsource table and the
subform's recordsource. For instance, if the Primary Key of the
mainform table is the date (and I don't know if that is the case), you
would use that field as the master/child link.

I did try using the Master- Child link but this did not for some
reason let
me do appropriate checks to ensure that a 'new' timesheet was properly
created
when it did not already exist.

In other words, Master-Child did not work in the way I expected it to
:-(
What are in fact the Recordsources of the main and subforms? What are
the master and child link fields? Could you perhaps post your code?

Well the Recordsource of the main form is a the table containing all
the timesheets, whereas the recordsource of the sub-form is the table
containing all the individual timesheet entries.

What I am trying to do I think, is to have the form setup so that
the subform only shows entries relevant to the timesheet concerned.
A problem arises becauses a timesheet can be project related OR
consultant
related. Maybe it's time for a re-design of the tables :-(
 
J

John Vinson

I did try using the Master- Child link but this did not for some
reason let
me do appropriate checks to ensure that a 'new' timesheet was properly
created
when it did not already exist.

In other words, Master-Child did not work in the way I expected it to
:-(

Well, I have no idea how your tables are in fact structured, nor what
you expected...

I'm taking a couple of weeks vacation and probably won't be backin the
groups. You may want to start a new thread, describing your tables
(indicate the Primary Key, how the tables are related, and what type
of information they contain) and how you would like the form to work.

John W. Vinson[MVP]
 

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

Top