A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Refresh causes unbound fields to be cleared



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old April 29th, 2008, 01:39 AM posted to microsoft.public.access.forms
TESA0_4
external usenet poster
 
Posts: 29
Default Refresh causes unbound fields to be cleared

I have a subform where a user is required to roughly estimate cost
allocations between several possible work categories. eg if there are 3
applicable work categories they might allocate a percentage split of
10%:70%:20%. I have an unbound field that sums the percentage to assist the
user with correct summing of the percentage allocations to 100%. A button (on
the parent form) that allows the user to move to the next record is coded to
ensure the total percentage allocation on the current record equals 100%
before allowing a move to the next record.
If the cursor is moved straight from a Percent field on the datasheet
subform to the Next Record button the unbound PercentSum field has not
updated so the percentage check on the command button is invalid. Inserting a
Refresh in the command button code results in the unbound field being cleared
until after the full subroutine has run.
How can I force a valid check of the percentage sum on the current record
before moving to the next record?
Thanks in anticipation of any advice!!

My current code:
Me.Refresh
If tblPackageZonessubform.Form!PercentSum.Value 100 Then
MsgBox ("The Percentage split does not total 100")
Exit Sub
End If
DoCmd.GoToRecord , , acNext

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.