I have two forms [fsubinputvoltag e] and [fsubelectronic] that have unbound calculated fields. Thes are both subforms to [frmHeaderMaster]. The field on [fsubinputvoltag e] is [calcAvailPower] and field for [fsubelectronic] is [calcOutputPower]. On [calcOutputPower] being dirty or updated I need a message box if [calcOutputPower] is greater than [calcAvailPower]. Can someone help?
13 1727
I believe that you would just need to use an AfterUpdate Event similar to this... - Private Sub calcOutputPower_AfterUpdate()
-
If calcOutputPower > Forms![frmHeaderMaster]![fsubinputvoltage].Form![calcAvailPower] Then
-
MsgBox ("It's Greater!")
-
End If
- End Sub
Good Luck,
Brad.
I believe that you would just need to use an AfterUpdate Event similar to this... - Private Sub calcOutputPower_AfterUpdate()
-
If calcOutputPower > Forms![frmHeaderMaster]![fsubinputvoltage].Form![calcAvailPower] Then
-
MsgBox ("It's Greater!")
-
End If
- End Sub
Good Luck,
Brad.
Getting #Name?.... Figured out this has something to do with my formula used to calculate the calcOutputPower .....will get back to you when I get this figured out.
AO3
Got other problem fixed.. Okay I have it semi working. It will work if I place a Command button and click on it using the following code: - Private Sub Command31_Click()
-
If Me.txtOutputPOwer.Value > Forms![frmHeaderMaster]![fsubInputVoltage].Form![calcAvailPower] Then
-
MsgBox ("It's Greater!")
-
End If
-
-
End Sub
However, if I use the following code... Nothing happens.... - Private Sub txtOutputPOwer_AfterUpdate()
-
If Me.txtOutputPOwer.Value > Forms![frmHeaderMaster]![fsubInputVoltage].Form![calcAvailPower] Then
-
MsgBox ("It's Greater!")
-
End If
-
End Sub
This is a subform on a tabcontrol.
You got me. Since you had it on a tab control, I placed mine on a tab control and tried it again in an AfterUpdate event without changing the code at all. Worked like a charm.
Oh well... as long as it's working I guess :)
no, I need to figure out why it isn't working.... Management is pretty intent on it working after update...
What version of Access are you using?
Access 2003 but saving in 2000 format. Also this is written as an Access project....if that makes any difference.
Can you post your code for frmHeaderMaster , and the 2 subforms?
yep
frmHeaderMaster - Option Compare Database
-
-
Private Sub Command43_Click()
-
On Error GoTo Err_Command43_Click
-
-
Dim stDocName As String
-
-
stDocName = "Application Inquiry Form"
-
DoCmd.SendObject acReport, stDocName, "SnapshotFormat(*.snp)", _
-
"DELETED", "", "", "This is a test.", "", False, ""
-
-
-
Exit_Command43_Click:
-
Exit Sub
-
-
Err_Command43_Click:
-
MsgBox Err.Description
-
Resume Exit_Command43_Click
-
-
End Sub
-
Private Sub Command45_Click()
-
On Error GoTo Err_Command45_Click
-
-
-
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
-
-
Exit_Command45_Click:
-
Exit Sub
-
-
Err_Command45_Click:
-
MsgBox Err.Description
-
Resume Exit_Command45_Click
-
-
End Sub
-
Private Sub Command46_Click()
-
On Error GoTo Err_Command46_Click
-
-
-
DoCmd.GoToRecord , , acNewRec
-
-
Exit_Command46_Click:
-
Exit Sub
-
-
Err_Command46_Click:
-
MsgBox Err.Description
-
Resume Exit_Command46_Click
-
-
End Sub
-
Private Sub Command47_Click()
-
On Error GoTo Err_Command47_Click
-
-
Dim stDocName As String
-
-
stDocName = "Application Inquiry Form"
-
DoCmd.OpenReport stDocName, acPreview, "", "[CrNo]=[Forms]![frmHeaderMaster]![CrNo]"
-
-
Exit_Command47_Click:
-
Exit Sub
-
-
Err_Command47_Click:
-
MsgBox Err.Description
-
Resume Exit_Command47_Click
-
-
End Sub
fsubelectronic - Option Compare Database
-
Private Sub Command31_Click()
-
If Me.txtOutputPOwer.Value > Forms![frmHeaderMaster]![fsubInputVoltage].Form![calcAvailPower] Then
-
MsgBox ("It's Greater!")
-
End If
-
-
End Sub
-
-
Private Sub txtOutputPOwer_AfterUpdate()
-
If Me.txtOutputPOwer.Value > Forms![frmHeaderMaster]![fsubInputVoltage].Form![calcAvailPower] Then
-
MsgBox ("It's Greater!")
-
End If
-
End Sub
fsubinputvoltag e has no module
txtOutputPOwer - =IIf([CoUom]="Oz.-In.",([ContRpm]*[ContTorq]/1352), IIf([CoUom]="Lb.-Ft.",([ContRpm]*([ContTorq]*192)/1352), IIf([CoUom]="Nm",([ContRpm]*([ContTorq]*141.6116)/1352), IIf([CoUom]="mNm",([ContRpm]*([ContTorq]*0.1416116)/1352)))))
calcAvailPower Sign in to post your reply or Sign up for a free account.
Similar topics |
by: SJH |
last post by:
I have been given an older database and asked to make upgrades and what not.
One interesting thing I have come across with the database is that it was at
one time set up so one of the tables would hold values that were calcuated
using a form. I have looked at the code for all the text boxes on the
assocatied forms and have yet to figure out how this was done. There were
two values set up this way, one still works and the other one...
|
by: Miguelito Bain |
last post by:
hi everybody.
i'm trying to find out what you can and can't do with/in calculated
fields. any help, pointers, and/or advice would be greatly
appreciated. i'm a newbie, but i want to learn, and i've tried a lot
before posting.
here's my situation.
i have a simple form with dates on it. i have an indate and outdate
|
by: Phil Stanton |
last post by:
I have a form of club members with a continuous subform on it showing boat
details.
I hold the boat length and beam (in meters) in a table. On the subform I
also calculate and show the imperial equivalent length and beam. You can
enter lengths in either the metric box when an AfterUpdate event shows the
imperial eqivalent, or converseley you can enter the lenght in feet and
inches in the imperial box and on AfterUpdate the metric...
|
by: tconway |
last post by:
I have an Access program that displays Customer data into a form and
OrderID data into a subform. The totals in the Subform are based on
calculated fields, i.e. the Total Amount field Calculates the
following: =*
The Subform Order fields are pulled from a Query along with each
calculated Total. They are displyed in a DataSheet View.
This works fine on my developement environment which includes a server
set up just as our client has. ...
|
by: DaveA |
last post by:
Our incident numbering system is based on the following YEAR 05 MONTH
06 NMBR 1234
looks like 05-06-1234
the counter number is manually reset each month and I would like to
make it automatic. I am having trouble with the comparing the old month
stored as two digit number as text with the new two digit month found
using format(date(),"mm")
| |
by: ey.markov |
last post by:
Greetings,
in A2K VBA, I set the following recordset:
Set rsGPValue = dbs.OpenRecordset("SELECT *,
DateSerial(Year(),Month()+4,0) FROM tblGPValue AS
OurDate, dbOpenSnapshot)
and then I try to use this calculated field:
If rsGPValue.Fields("OurDate") > {Forms]!!.Value
|
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: Henrik |
last post by:
The problem is (using MS Access 2003) I am unable to retrieve long
strings (255 chars) from calculated fields through a recordset.
The data takes the trip in three phases:
1. A custom public function returns a long string. This works.
2. A query has a calculated field based on the custom function above.
This works when the query is run directly.
|
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 the form based on this calculated interval (i.e., i want to search for records specifically where...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |