473,569 Members | 3,054 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with an Auto calculated field

20 New Member
Wonder if I can get someone’s help with a problem I am having on where to place an IF statement in VBE. I have created a form in Access 2003 that has an automatic calculated field. Basically you enter information into other fields and the Running Total field automatic recalculates itself whenever the other data fields are updated. The problem I am having is that I need a message box to come up as soon as the Running Total reaches a certain point. Writing the IF statement I don’t think is the problem, but not sure what event to put it under. I have tried the AfterUpdate field under the Running Total properties, but have read that because the Running Total field is an automatic calculated field, that you can’t put IF statements there. It didn’t work when I did anyways. Below is kind of a sample of what I am trying to do:

Data Field 1 = 3
Data Field 2 = 8
Date Field 3 = 5
Date Field 4 = 2

Running Total = 18 PM Cycle =16

Running Total automatically adds up the Data Fields as soon as the operator enters in the numbers. I need to put an IF statement somewhere that will give me a message box to let the operator know as soon as the Running Total is >= to the PM Cycle. But like I have said before, I have tried to put an IF statement in various place, but it will not come up when the Running Total reaches the > = PM Cycle

Thanks
Steve
Apr 8 '08 #1
6 1819
MindBender77
234 New Member
Are your DataFields and Running Total fields displayed as unbound textboxes on your form? Also, how are you trigging the auto calculate to run?

Let us know which type of controls you are using so we can better assist you.

Bender
Apr 8 '08 #2
Steve67
20 New Member
The data fields are bound to a table and the auto calculate feature is done through the query and the form is made from that query.

Let me know if there is anymore information you would need

Thanks
Steve
Apr 8 '08 #3
MindBender77
234 New Member
The data fields are bound to a table and the auto calculate feature is done through the query and the form is made from that query.

Let me know if there is anymore information you would need

Thanks
Steve
One possible solution would be to create a custom subroutine that contains your "if" statement. In the OnExit event of each data field, call this subroutine. This way, if at any point during the data entry,a message box will appear if the criteria you specified is met.

Hope the Helps,
Bender
Apr 8 '08 #4
Steve67
20 New Member
I was thinking about something a long those lines, but was trying to see if there was a short way of doing it without having to write extra code.

Thanks, I will give that a try
Apr 8 '08 #5
MindBender77
234 New Member
I was thinking about something a long those lines, but was trying to see if there was a short way of doing it without having to write extra code.

Thanks, I will give that a try
To shorten the code you could just call the subroutine from the OnExit event of the last data field. The problem with this is you would have to make sure that the focus at some point in the data entry would go through the last data field.
Bender
Apr 8 '08 #6
Steve67
20 New Member
Thanks for your help. I tried the OnExit event and so far it is working

Thanks
Steve
Apr 9 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2326
by: Norbert Lieckfeldt | last post by:
MS Access 2002 here. I am just trying to set up a simple database for a friend who's an optician. Basically, all clients with address details, date of last eyetest and a drop-down combo box to choose a number of months to the next eyetest (3,6,12,24). I then have a calculated field in the form which works out the date of the next appointment...
2
5348
by: hhathome | last post by:
In my report I have a calculated DateDiff Field, I also have a calculated count field. I'm trying to get a total of the DateDiff field and dividing it by the count field and I'm having problems -- it seems the calculated field is not storing the data for reuse, maybe -- does anyone have any suggestions? Thanks
2
1190
by: Sara | last post by:
The problem: Conditional formatting bold, red when field Value < date() sets the field background to white - always - whether condition is met or not. I want the field unfilled and just red/bold when the date has passed. Background: I have 2 related fields that are only rarely active, so I manage them in the query for the subform:...
7
3218
by: Br | last post by:
I'm sure this has been answered before but I can't dig up any posts that give a good answer.. and I'm sure I've come across it before but forget how I dealt with it. I have an ADP (A2000, SQL2000). I have a form with a linked subform. The subform list expense records and there is an unbound calculated textbox in the form footer to Sum() the...
4
2234
by: Steve_s | last post by:
Hi I am having problems totalling a particular field in a subform.I am using Access 2003. The subform is based on a query which selects records with various financial information. I have 5 text boxes in the form footer which total certain fields. I have no problem totalling 4 of the fields, but one field which is a calculated field ( ie...
3
4735
by: kelley.l.turner | last post by:
Hi all, I am very new to MS Access so please bear with me! I have created a simple calculated field in my data entry form, yet when I view my data table or try to generate a report based on this calculated field, no value is posted. How/where do I get my calculated values to also show up in the tables and reports? Thanks, Kelley
2
5518
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by Form" in order to search for records based on this form, I would like to be able to enter a value in this "days" control so that I can filter records on...
4
3397
by: khengi | last post by:
Hi, I'm a newbie, so I guess this is a question that expresses my total ignorance, but never the less: I have an old table into which I want to add a column that will automatically update based on one of the existing columns. The existing column contains a text string, and the new one should contain a part of it, using text trancation...
6
12414
by: awojciehowski | last post by:
I am working with a database now and need some guidance. I am attempting to input an auto calculation. I have the ability to enter a date in a text box on a form. I want to be able to have another field that auto calcuates 90 days later and simiply displays that date. The auto calculated date does NOT have to be assiocated with a field in...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.