Re: Sub form events not firing
- From: Bobby <bobby2@xxxxxxxxxxxxxxxx>
- Date: Thu, 26 Mar 2009 05:22:45 -0700 (PDT)
On 26 Mar, 09:43, Roger <lesperan...@xxxxxxxxxx> wrote:
On Mar 26, 2:19�am, Bobby <bob...@xxxxxxxxxxxxxxxx> wrote:
Hi folks,
I'm using Access 2007 as the front end and SQL server as the backend
of an application I have written. I am also using Windows XP.
I have a subform which holds employee time bookings for the day, held
as minutes. The idea is, when an employee is selected from the main
form, all of his / her bookings display in the subform.
However, I need to total these minutes to display in the subform
footer. I want the total minutes to display as hours and minutes, not
just a sum of minutes.
My basic problem is, I can't find an event on the subform which fires
when the sub form has been completely populated. On Open, On Activate,
non of them fire. Is there a way of making an event fire when the sub
form is populated with new data?
I have attempted two ways of getting round this. Firstly I have used
the sum function in a control source in the sub form footer as follows
=sum([mins]/60). As you might expect, this gives slightly odd results..
For example 2 hours 25 minutes is displayed as 2.42 hours.
My second method is to write a function which I also call from a
control source, i.e. =TSHoursAndMinutes(). I know that this works ok,
because if I put it on a button it gives exactly the right result,
i.e. 2 hours 25 minutes. However on the control source it always
returns 0 hours 0 minutes.
It's almost as if, unlike the sum function, my function runs before
the detail section gets populated.
Any ideas how I can get round this. It seems like it should be so
simple to me, yet it's causing me real problems.
Thanks for any help,
Colin
in the footer, create a text box (invisible) called minutes, =sum(..)
create as 2nd visible text box, =cint(minutes / 60) & ":" & (minutes
mod 60)- Hide quoted text -
- Show quoted text -
Thanks. I found it worked better with Fix rather than CInt, but thats
great,
Colin
.
- Follow-Ups:
- Re: Sub form events not firing
- From: hans . updyke
- Re: Sub form events not firing
- References:
- Sub form events not firing
- From: Bobby
- Re: Sub form events not firing
- From: Roger
- Sub form events not firing
- Prev by Date: UK Date format
- Next by Date: Re: VBA string bug?
- Previous by thread: Re: Sub form events not firing
- Next by thread: Re: Sub form events not firing
- Index(es):
Relevant Pages
|