Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform not updating on unbound form 1

Status
Not open for further replies.

dweis

IS-IT--Management
Apr 17, 2001
48
US
Hi, I have an unbound form comprised of at least 7 subforms but only 2 are visible.
This is for timesheet data where a time shouldn't exceed 60 hours over 7 days or 70 hours over 8 days(trucking operation)

Data is pulled from these based on data entered in subfrm1. Subfrm2 shows data for the last 7 days based on the date entered in subfrm1 and then a control on the unbound form, text1, shows the total hours for the previous 7 days.
The problem is that the data is entered the following morning, so I need the subform not to show (dateworked - 1) - 7 but the current date being entered and the previous 6 which would take the hours just entered into consideration. I have tried the requery command and I know my syntax is right because the form refreshes and it worked just fine before having to make this change, however the current record doesn't show up. I can see the control that drives the underlying query for subfrm2 and it is the correct date, say 7/8/2004, but the subform only shows 7/3/2004 and before.

I've tried accmdsave to save the record then requery the subform but it doesn't work either BUT when I open the query that is the record source of subfrm2 manually the current record shows up. All my commands take place in the Timeout control's on lost focus event (after update doesn't work because we have to enter no time for weekends which shows 0 hours worked) Any suggestions? I appreciate any help you can provide.
 
dweis

Instead of ReQuery, use the Refresh menu option...[tt]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
[/tt]

This will ensure the data is written to the table and is therefore available to form for calculations.

Richard
 
Works great. Thanks for the tip, I was struggling with that one. It's amazing how sometimes the little stuff is overlooked. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top