SubReport on Form (1 Viewer)

JamesJoey

Registered User.
Local time
Yesterday, 22:25
Joined
Dec 6, 2010
Messages
608
About a week ago we worked on a subreport on a form that persistently showed the
unused part of the report.
Most of it has been cleared but it still shows the unused part under certain conditions.
The subreport has fields for reminders: ReminderDate, ReminderTime and Reminder.
I click on the Reminder and I open an editing form from which I can edit the Reminder
or delete the reminder. This occurs when I select the last reminder and change the date to an earlier
date and close the editing form. The space where the data was, show up white unless I close and
reopen the form.
When I add a new reminder and the date is later than the other reminder it doesn't
get requeryed, showing only the the date. Unless I close and reopen the form.
I've spent the last week trying to remedy this with no luck.

If there seems to be no solution then how might I accomplish the same thing with
a continuous form.
If anyone's interested I attached the pertinent objects.
 

Attachments

  • SubReportOnForm.accdb
    728 KB · Views: 236

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 03:25
Joined
Jul 9, 2003
Messages
16,271
Why not use a form?
 

Attachments

  • SubReportOnForm_UG_Edit.zip
    116.3 KB · Views: 345

June7

AWF VIP
Local time
Yesterday, 18:25
Joined
Mar 9, 2014
Messages
5,463
I suspect reason is because of the grouping that is available with report.

Only thing I can suggest to emulate the report grouping would be a treeview control.
 

JamesJoey

Registered User.
Local time
Yesterday, 22:25
Joined
Dec 6, 2010
Messages
608
I thought about a tree view. I'll look into it.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:25
Joined
Feb 19, 2002
Messages
43,213
I don't see the problem. Can you take a copy of the form and mark the problem for us?
 

JamesJoey

Registered User.
Local time
Yesterday, 22:25
Joined
Dec 6, 2010
Messages
608
I don't see the problem. Can you take a copy of the form and mark the problem for us?
1628980047238.png
1628980216965.png
 

isladogs

MVP / VIP
Local time
Today, 03:25
Joined
Jan 14, 2017
Messages
18,209
I've created a continuous subform to mimic your report
I've quickly tested adding new records & deleting the last record.
It seems to work OK in my quick tests. See what you think....

1629029035616.png
1629029177352.png


I've also added code to allow easy editing of a record by double clicking on the reminder
 

Attachments

  • SubReportOnForm_CR_Edit.zip
    60.2 KB · Views: 341

JamesJoey

Registered User.
Local time
Yesterday, 22:25
Joined
Dec 6, 2010
Messages
608
Great!
Exactly what I was looking for!
I want to thank you for your time and effort. It is appreciated.

I'm 66. 20 years ago I would have worked on this myself but I'm too lazy now.

Again thanks much,
James
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:25
Joined
Feb 19, 2002
Messages
43,213
Thanks for the picture. I didn't see the problem because it didn't occur on my PC..

Colin made a great solution:)
 

isladogs

MVP / VIP
Local time
Today, 03:25
Joined
Jan 14, 2017
Messages
18,209
@JamesJoey
You're a youngster compared to me!
In fact, it only took me about 15 minutes to do

In general, you should avoid using reports as subforms as you lose functionality.
Similarly avoid using forms as subreports... unless you really have no alternative.
 

JamesJoey

Registered User.
Local time
Yesterday, 22:25
Joined
Dec 6, 2010
Messages
608
Is there a way to group by date?
That was my aim.
I can deal with the way it is.
 

isladogs

MVP / VIP
Local time
Today, 03:25
Joined
Jan 14, 2017
Messages
18,209
Ha! I wondered when you would notice that.

Unfortunately its not so easy to do on a form as on a report as it doesn't have a sorting & grouping feature
Also forms don't have a Hide Duplicates property

I did think about putting the date line ONLY in the subform with the event in a sub-subform
BUT that's not possible as its a continuous form

I'll think about it a bit more & let you know if I come up with a simple solution
 

JamesJoey

Registered User.
Local time
Yesterday, 22:25
Joined
Dec 6, 2010
Messages
608
I didn't see it right away.
I'm currently using a crude week view with 7 subforms and the dates across the top.

Thanks again.
 

isladogs

MVP / VIP
Local time
Today, 03:25
Joined
Jan 14, 2017
Messages
18,209
Something like this but for one week only?

CalendarMonth.gif

What I liked about your original design was its clean & elegant simplicity.
Trying to provide grouping on a subform will likely necessitate losing that elegance.
 

JamesJoey

Registered User.
Local time
Yesterday, 22:25
Joined
Dec 6, 2010
Messages
608
I did like the clean look. I was unable to resize it properly in Paint.
I don't go from Sun to Sat. Tomorrow the first day will be Monday.

Untitled.png
 

isladogs

MVP / VIP
Local time
Today, 03:25
Joined
Jan 14, 2017
Messages
18,209
It still looks Good. If you wanted, you could remove the white borders for a slightly cleaner look
Anyway, hope your shingles jab goes well. Having had shingles last year, I'll have that jab as soon as its available to me. Only for those over 70 in the UK
 

JamesJoey

Registered User.
Local time
Yesterday, 22:25
Joined
Dec 6, 2010
Messages
608
I've been putting the shingles vac off.
I can use a darker color for the borders.
 

isladogs

MVP / VIP
Local time
Today, 03:25
Joined
Jan 14, 2017
Messages
18,209
I went back to this and have worked out a way of grouping the subform by date using a subquery:

1629139630313.png


I believe this provides the layout you wanted whilst retaining the original clean, simple layout

The subquery is used to give a rank order by day:
Code:
SELECT tblReminders.ReminderDate, tblReminders.ReminderID, tblReminders.ReminderTypeID, tblReminders.ReminderTime, tblReminders.Reminder,
(SELECT Count(ReminderID) +1 As HowMany FROM tblReminders AS Dupe
WHERE Dupe.ReminderID> tblReminders.ReminderID AND Dupe.ReminderDate= tblReminders.ReminderDate) AS RankByDay
FROM tblReminders
WHERE (((tblReminders.ReminderDate) Between Date() And Date()+7))
ORDER BY tblReminders.ReminderDate, tblReminders.ReminderID DESC;

NOTE: I also changed your date filter to Between Date() And Date()+7
Results as used above are:

1629139679967.png


Let me know if you need me to explain how the subquery works

Conditional formatting is then used to 'hide' the date values where the RankByDay value >1
As you can't actually hide fields using CF, I've made the forecolor the same as the form backcolor

Hope its useful to you
 

Attachments

  • SubReportOnForm_CR_Edit_v2.zip
    59.2 KB · Views: 202
Last edited:

JamesJoey

Registered User.
Local time
Yesterday, 22:25
Joined
Dec 6, 2010
Messages
608
So far so good. One thing though and it's not that important.
When I place the Reminder field below the ReminderDate by Day the space between the rows are large.
Untitled.png

As you can see here. I can keep it with one row.
 

Users who are viewing this thread

Top Bottom