473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Which event to use to run calculations based off data.

When oopeening a form based of a table I need to run a function to do
some calculations. Which form event do I need to use that will
automatcally run when the form is opened but all the data from the
record is available.

Tried a few that seems to make sense but I believe I am missing
something obvious.
Nov 13 '05 #1
4 1574
Have you tried the Form Activate event?

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Ben McLaurin" <be****@gmail.com> wrote in message
news:eb**************************@posting.google.c om...
When oopeening a form based of a table I need to run a function to do
some calculations. Which form event do I need to use that will
automatcally run when the form is opened but all the data from the
record is available.

Tried a few that seems to make sense but I believe I am missing
something obvious.

Nov 13 '05 #2
"Steve" <no****@nospam.spam> wrote in message news:<ds****************@newsread2.news.atl.earthl ink.net>...
Have you tried the Form Activate event?

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Ben McLaurin" <be****@gmail.com> wrote in message
news:eb**************************@posting.google.c om...
When oopeening a form based of a table I need to run a function to do
some calculations. Which form event do I need to use that will
automatcally run when the form is opened but all the data from the
record is available.

Tried a few that seems to make sense but I believe I am missing
something obvious.

I get "Microsft Access can't find the field 'ID' referred to in your
expression at this line "If IsNull(Forms!Entries![ID]) Then" That
field is in the form and this very same function runs no problem when
using the form, just not when opening it. So is the form considered
active before all the form elements are there and the table openned? I
guess I need am event that the form is completly openned and data
availale.
thanks.
Nov 13 '05 #3
"Steve" <no****@nospam.spam> wrote in message news:<ds****************@newsread2.news.atl.earthl ink.net>...
Have you tried the Form Activate event?

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Ben McLaurin" <be****@gmail.com> wrote in message
news:eb**************************@posting.google.c om...
When oopeening a form based of a table I need to run a function to do
some calculations. Which form event do I need to use that will
automatcally run when the form is opened but all the data from the
record is available.

Tried a few that seems to make sense but I believe I am missing
something obvious.


Found my problem. It was the interface between the keyboard and the
chair. The column in the table is called ID and the control source is
proper. For some reason I called the field Rider_ID, hence the error.
Also I have no idea why the function even works afterwords since I
can't find the field in the form.

Also I discovered it will not work anyways since this form is
activated by clicking on a button in another. That action not only
opens the form but activates the visablty of some controls and creates
the underlining query for the form itself. The open event and active
even happesn beore the function is done. So a little rewritting of
some code should work.

Thanks
Nov 13 '05 #4
When the Activate event fires, all the controls on the form are loaded and the
data from the first record in the record source is loaded into all the controls.
The message you are getting is saying there is no control on the form named
"ID". Perhaps you have the name of the field confused with the name of the
control that holds the field. Open your form in design view and select the
control you think is "ID". Open properties and go to the Other Tab. You will see
the Name property there. What ever value is there is the value you need to have
inside the square brackets in this expression:
Forms!Entries![ID]

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Ben McLaurin" <be****@gmail.com> wrote in message
news:eb**************************@posting.google.c om...
"Steve" <no****@nospam.spam> wrote in message

news:<ds****************@newsread2.news.atl.earthl ink.net>...
Have you tried the Form Activate event?

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Ben McLaurin" <be****@gmail.com> wrote in message
news:eb**************************@posting.google.c om...
When oopeening a form based of a table I need to run a function to do
some calculations. Which form event do I need to use that will
automatcally run when the form is opened but all the data from the
record is available.

Tried a few that seems to make sense but I believe I am missing
something obvious.

I get "Microsft Access can't find the field 'ID' referred to in your
expression at this line "If IsNull(Forms!Entries![ID]) Then" That
field is in the form and this very same function runs no problem when
using the form, just not when opening it. So is the form considered
active before all the form elements are there and the table openned? I
guess I need am event that the form is completly openned and data
availale.
thanks.

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
0
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
2
by: brian kaufmann | last post by:
I'd appreciate your ideas on this. I need to make the calculation for unemployment rate for three different data sources (A,B,C) for many countries and age groupings: unemployment rate = number...
10
by: Mark Givens | last post by:
Ok, I have read more website tutorials on C# arrays than I really wanted too and am still completely blured on the subject. I normally develop websites using PHP/MySql, but have been forced into a...
2
by: Ronald Geyeshock | last post by:
Hello All, I am trying to find a way to process some logic in the code-behind of an ASP.Net page after a response has been sent back to the client. Basically, I want to be able to process some...
7
by: rohitsripathi | last post by:
i need help writing this program... i am in college and i do not have time do this right now as i need to study for another test....but this is due tonight...i will pay $5 if you accept to do it and...
5
by: Kevin | last post by:
I want a calculated control to transfer its value to a bound field in a table. I.e. I have a calculated control named txtFinalBid that adds several fields in a table. I want that number to be...
24
by: =?Utf-8?B?U3dhcHB5?= | last post by:
Can anyone suggest me to pass more parameters other than two parameter for events like the following? Event: Onbutton_click(object sender, EventArgs e)" Event handler: button.Click += new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...

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.