446,401 Members | 928 Online
Need help? Post your question and get tips & solutions from a community of 446,401 IT Pros & Developers. It's quick & easy.

# I need help in verifying a value of an unbound textbox

 P: 8 Hi experts, I was wondering if you could help me out here. AccumulationSum is an unbound textbox that calculates the sum of bound field Accumulation. The control source is =Sum([Accumulation)] Whe I try to verify the value using the code below, nothing happens. Private Sub AccumulationSum_AfterUpdate() If Me.AccumulationSum >= "21.0" Then MsgBox "Accumulation has reached its maximum!" End If End Sub Can anyone pease tell me what I'm doing wrong and help me with a solution. Thanks, Enrique Dec 17 '07 #1
11 Replies

 Expert 100+ P: 1,923 Hi experts, I was wondering if you could help me out here. AccumulationSum is an unbound textbox that calculates the sum of bound field Accumulation. The control source is =Sum([Accumulation)] Whe I try to verify the value using the code below, nothing happens. Private Sub AccumulationSum_AfterUpdate() If Me.AccumulationSum >= "21.0" Then MsgBox "Accumulation has reached its maximum!" End If End Sub Can anyone pease tell me what I'm doing wrong and help me with a solution. Thanks, Enrique You are formatting the number as text by enclosing it in quotes.. Change this: If Me.AccumulationSum >= "21.0" Then To: If Me.AccumulationSum >= 21.0 Then Dec 17 '07 #2

 P: 8 You are formatting the number as text by enclosing it in quotes.. Change this: If Me.AccumulationSum >= "21.0" Then To: If Me.AccumulationSum >= 21.0 Then Thanks PDB(puppydogbuddy) but I just tried it..still doesn't bring up the message box. :( Dec 17 '07 #3

 Expert 100+ P: 1,923 Thanks PDB(puppydogbuddy) but I just tried it..still doesn't bring up the message box. :( Ok, check your table and verfy that Accumlation is numeric data type. Change this: The control source is =Sum([Accumulation)] To: The control source is =Sum([Accumulation]) Dec 17 '07 #4

 P: 8 Hi PDB, Thanks for the quick reply. The data type for Accumulation is Currency and the Format is Fixed in the table as it is the only type I know that would allow decimals to show. Is there another way around this? Thanks again, Enrique Dec 17 '07 #5

 Expert 100+ P: 1,923 Hi PDB, Thanks for the quick reply. The data type for Accumulation is Currency and the Format is Fixed in the table as it is the only type I know that would allow decimals to show. Is there another way around this? Thanks again, Enrique It should be working. Currency and fixed are numeric data types. Dec 17 '07 #6

 Expert 2.5K+ P: 3,532 The problem is that you have your code in the Sub AccumulationSum_AfterUpdate event, and this event never fires because AccumulationSum is a calculated field! AfterUpdates only fire if data is manually entered into the field. Move your code to the Accumulation_AfterUpdate event instead! Welcome to TheScripts! Linq ;0)> Dec 17 '07 #7

 Expert 100+ P: 1,923 The problem is that you have your code in the Sub AccumulationSum_AfterUpdate event, and this event never fires because AccumulationSum is a calculated field! AfterUpdates only fire if data is manually entered into the field. Move your code to the Accumulation_AfterUpdate event instead! Welcome to TheScripts! Linq ;0)> Linq, Talk about overlooking the obvious! I was so focused on the text vs numeric issue that I didn't notice what event proc he was using pDog. Dec 17 '07 #8

 Expert 2.5K+ P: 3,532 And, of course, the two field names were so close! I had to flip back and forth to verify which field was which! ;0)> Dec 17 '07 #9

 P: 8 The problem is that you have your code in the Sub AccumulationSum_AfterUpdate event, and this event never fires because AccumulationSum is a calculated field! AfterUpdates only fire if data is manually entered into the field. Move your code to the Accumulation_AfterUpdate event instead! Welcome to TheScripts! Linq ;0)> Hey MissingLinq! It turns out that your input was THE missing Link!!! Thanks a Million!!!! Thanks for the Welcome. I'm sure I'll be a frequent client!!!! This Forum ROCKS!!!! Enrique Dec 17 '07 #10

 Expert 2.5K+ P: 3,532 Glad we could help! Linq ;0)> Dec 17 '07 #11

 P: 8 Linq, Talk about overlooking the obvious! I was so focused on the text vs numeric issue that I didn't notice what event proc he was using pDog. You're quick assistance was still much appreciated, PDB!!! Dec 17 '07 #12