S
slowuptake
slowly feeling my way forward as usual ....
I have a main form that contains 3 unbound combo boxes allowing user to
choose employee, month and year (of monthly timesheets). Event code in a
button on main form then collects the value of the timesheet ID (primary key
of table linked to main form). However at this point the event code simply
stores the value of the timesheet ID in a local variable and doesn't do
anything with it.
I drug a subform into the main form, and manually linked the master and
child fields (using the field name of the main and sub forms respectively).
The primary key of the main form is a field in the table underlying the
subform.
What I want to achieve is:
1) use the local variable from the button event to restrict/filter the data
in the main form to the unique timesheet ID corresponding to the variable, or
simply set the form so that it is at the correct record
2) display all the records in the subform that have the same value of
timesheet ID as in the restricted/filtered main form.
Do I accomplish this by adding to the button event code? Or add code
elsewhere?
Do I sort/filter the table underlying the main form to result in ony one
record? Or do I use something like GoToRecord?
Will filtering or going to correct record in main form allow the subform to
sort by itself, or will it need more instruction?
regards,
slowuptake
I have a main form that contains 3 unbound combo boxes allowing user to
choose employee, month and year (of monthly timesheets). Event code in a
button on main form then collects the value of the timesheet ID (primary key
of table linked to main form). However at this point the event code simply
stores the value of the timesheet ID in a local variable and doesn't do
anything with it.
I drug a subform into the main form, and manually linked the master and
child fields (using the field name of the main and sub forms respectively).
The primary key of the main form is a field in the table underlying the
subform.
What I want to achieve is:
1) use the local variable from the button event to restrict/filter the data
in the main form to the unique timesheet ID corresponding to the variable, or
simply set the form so that it is at the correct record
2) display all the records in the subform that have the same value of
timesheet ID as in the restricted/filtered main form.
Do I accomplish this by adding to the button event code? Or add code
elsewhere?
Do I sort/filter the table underlying the main form to result in ony one
record? Or do I use something like GoToRecord?
Will filtering or going to correct record in main form allow the subform to
sort by itself, or will it need more instruction?
regards,
slowuptake