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

Access 2000 Calculations

P: n/a
I want to base a result in a control on input to another control. For
instance, If [Result]= "fraud*" then [Amt10] = 0 and [Amount45]=
[Amount]. If [result] equals anything else, then [Amt10]= either 2500
(if [amount]>=2500) or [Amt10]=[amount](if [amount] is <2500). [Amt45]
is the difference between [amount]-[amt10].

I can explain it but I'm having difficulty figuring out the best way to
do it. Any help would be appreciated.

Preston Holod

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Pres Holod <ho***@optonline.net> wrote in message news:<40**********************@news.newsgroups.ws> ...
I want to base a result in a control on input to another control. For
instance, If [Result]= "fraud*" then [Amt10] = 0 and [Amount45]=
[Amount]. If [result] equals anything else, then [Amt10]= either 2500
(if [amount]>=2500) or [Amt10]=[amount](if [amount] is <2500). [Amt45]
is the difference between [amount]-[amt10].

I can explain it but I'm having difficulty figuring out the best way to
do it. Any help would be appreciated.

Preston Holod

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Make these calculated controls and use IIF or use VB in the
AfterUpdate(?) event of the [Result] control
Nov 13 '05 #2

P: n/a
While I appreciate any help, I am truly a novice and have little idea
how to do what you suggest. Any further help would be appreciated.
Thanks.

Preston Holod

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

P: n/a
Pres, If I'm understanding correctly set the AfterUpdate event of your
Result field to run the following procedure. To do that open the form in
design mode and double-click the result field control on the form. This
will open the properties window. Click the event tab then click the
ellipsis(...) to the right of the After Update event. This will open the
code window. Cut and paste the code below between the Private Sun and End
Sub lines in the code window. Replace the names of the fields with those in
your application where applicable.

Private Sub Result_AfterUpdate()
'If [Result]= "fraud*" then [Amt10] = 0 and [Amount45]=
'[Amount]. If [result] equals anything else, then [Amt10]= either 2500
'(if [amount]>=2500) or [Amt10]=[amount](if [amount] is <2500).

' I'm not sure about the statement below cause above you set Amnt45 = Amount
'[Amt45] is the difference between [amount]-[amt10].

Dim str As String
str = UCase(Left(Me.Result, 5))

If str = "FRAUD" Then
Me.Amnt10 = 0
Me.Amnt45 = Me.Amnt
Else
If Nz(Me.Amnt, 0) >= 2500 Then
Me.Amnt10 = 2500
Else
Me.Amnt10 = Me.Amnt
End If
'I added this cause I'm not sure about your description above
Me.Amnt45 = Nz(Me.Amnt, 0) - Nz(Me.Amnt10, 0)
End If
End Sub

Hope it helps.

--
Reggie

----------
"Pres Holod" <ho***@optonline.net> wrote in message
news:40**********************@news.newsgroups.ws.. .
While I appreciate any help, I am truly a novice and have little idea
how to do what you suggest. Any further help would be appreciated.
Thanks.

Preston Holod

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.