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
6 1819
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
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
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
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
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
Thanks for your help. I tried the OnExit event and so far it is working
Thanks
Steve
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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
|
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:...
|
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...
|
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...
| |
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
|
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...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |