Here's my delema

  • Thread starter Afrosheen via AccessMonster.com
  • Start date
A

Afrosheen via AccessMonster.com

First of all thanks for reading this.
I have been trying to get this thing to work for a week now and it doesn't.
First of all I have a report and a sub report. The first report Report1 is
just a form letter. The second Report2 populates with information from a
"query" called strWhere. The form I'm getting my information from its control
source is call qrytaps.

Here is the code for creating the routine.

stDocName = "Report1"
strWhere = "([supervisor] = """ & Me.cboloc & """) AND " _
& "([workplan] = """ & Me.Combo149 & """)"

DoCmd.OpenReport stDocName, acPreview, , strWhere

When it opens, the Report1 report shows the supervisor. The subform Report2
show ALL the records within the work plan. And it shows all the records based
on month correctly. I have a Master/Child link of Workplan. I would like the
Master/Child like to be the person's Id. Don't know if that can happen. Now
here's the problem.

The above strWhere does not work all the way. For example I have a form where
you choose supervisor {cboloc} and then you choose the workplan month
{combo149}. When the report comes up then it will show me all the records
that have a workplan of January. It doesn't matter who the supervisor is. On
Report1 it shows the filter stWhere correctly.

What I'm trying to do is when I select the supervisor and the month the sub
form will just get just the records/information that pertain to that
supervisor and month.

I'm lost and frustrated. Any help would be appreciated.
Thanks for the help.
 
A

Afrosheen via AccessMonster.com

I found out part of my problem. What was happening was that instead of
getting a subform with {We'll say 3 records} I was getting a subform with one
record and three different reports. I need it with all the records on one
subform. Not a report for each record.
First of all thanks for reading this.
I have been trying to get this thing to work for a week now and it doesn't.
First of all I have a report and a sub report. The first report Report1 is
just a form letter. The second Report2 populates with information from a
"query" called strWhere. The form I'm getting my information from its control
source is call qrytaps.

Here is the code for creating the routine.

stDocName = "Report1"
strWhere = "([supervisor] = """ & Me.cboloc & """) AND " _
& "([workplan] = """ & Me.Combo149 & """)"

DoCmd.OpenReport stDocName, acPreview, , strWhere

When it opens, the Report1 report shows the supervisor. The subform Report2
show ALL the records within the work plan. And it shows all the records based
on month correctly. I have a Master/Child link of Workplan. I would like the
Master/Child like to be the person's Id. Don't know if that can happen. Now
here's the problem.

The above strWhere does not work all the way. For example I have a form where
you choose supervisor {cboloc} and then you choose the workplan month
{combo149}. When the report comes up then it will show me all the records
that have a workplan of January. It doesn't matter who the supervisor is. On
Report1 it shows the filter stWhere correctly.

What I'm trying to do is when I select the supervisor and the month the sub
form will just get just the records/information that pertain to that
supervisor and month.

I'm lost and frustrated. Any help would be appreciated.
Thanks for the help.
 
A

Amy E. Baggott

How is your subform joined to your main form? Your best bet is to make sure
that the supervisor's ID is a field in the record sources for both your main
form and your subform. Then you can join them on the supervisor ID, filter
your subreport by the month, and that should take care of it.
 
A

Afrosheen via AccessMonster.com

Thanks Amy for getting back to me. I'll check it out and get back to you
How is your subform joined to your main form? Your best bet is to make sure
that the supervisor's ID is a field in the record sources for both your main
form and your subform. Then you can join them on the supervisor ID, filter
your subreport by the month, and that should take care of it.
First of all thanks for reading this.
I have been trying to get this thing to work for a week now and it doesn't.
[quoted text clipped - 29 lines]
I'm lost and frustrated. Any help would be appreciated.
Thanks for the help.
 
A

Afrosheen via AccessMonster.com

Thanks again for the help. Could you please advise how I could do this? I'm
sorry I have hardly and experience with join queries.

Thanks.
Thanks Amy for getting back to me. I'll check it out and get back to you
How is your subform joined to your main form? Your best bet is to make sure
that the supervisor's ID is a field in the record sources for both your main
[quoted text clipped - 5 lines]
 
A

Afrosheen via AccessMonster.com

Hi Amy and thanks for getting back to me. I do have the main and sub forms
master/child link on StaffId. I didn't see where I could filter the subform
on the month though.

Wouldn't the subform record source be the same as the main form/report?
How is your subform joined to your main form? Your best bet is to make sure
that the supervisor's ID is a field in the record sources for both your main
form and your subform. Then you can join them on the supervisor ID, filter
your subreport by the month, and that should take care of it.
First of all thanks for reading this.
I have been trying to get this thing to work for a week now and it doesn't.
[quoted text clipped - 29 lines]
I'm lost and frustrated. Any help would be appreciated.
Thanks for the help.
 

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