By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,358 Members | 2,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,358 IT Pros & Developers. It's quick & easy.

Which event to use to run calculations based off data.

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
"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

P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.