I have a text box and a submit button in MS ACCESS
and i want to check if the number entered is positive or negative.
So if 3 is entered and i click submit, it writes a message on the screen saying "negative"
can someone help with some code logic
I have a text box and a submit button in MS ACCESS
and i want to check if the number entered is positive or negative.
So if 3 is entered and i click submit, it writes a message on the screen saying "negative"
can someone help with some code logic
here is my logic:
Code:Private Sub submit_Click() Dim txtNumber As Integer Dim submit If txtNumber + Abs(txtNumber) = 0 Then MsgBox "Negative" Else MsgBox "Positive" End If End Sub
also need to write some code on :
Finding the largest and smallest numbers from a list held in a file. Assume that each number is on a separate line.
Calculating the mean, median and mode of a series of numbers entered by a user from the keyboard.
Moved to Access Forum
Join our Folding team: DeveloperBarn Folding
-----------------------------------
• Folding Stats - Stanford University
• Folding Stats - Extreme Over-Clocking
• Folding Stats - Kakao Stats
• Folding Stats - Xtreme CPU
-----------------------------------
Join our Folding team: DeveloperBarn Folding
-----------------------------------
• Folding Stats - Stanford University
• Folding Stats - Extreme Over-Clocking
• Folding Stats - Kakao Stats
• Folding Stats - Xtreme CPU
-----------------------------------
I'm afraid that is not the definition of a median. Median is the value of the item for which half the values are greater and half are less. As a simple example, if you have the values: 23, 28, 31, 40, 52, 66, 74, the median is 40, not (7 + 1) / 2, or 4. (And the mean, or average, is their sum divided by the count, in this case about 44.85...)
Last edited by don94403; February 23rd, 2010 at 11:43 PM.
question = 2B || !2B
sorry, didn't explain it correctly, meant to say that you count how many numbers you have; in don's example, he had 7 numbers. you add 1 to the count which makes 8, and divide by 2, which gives you 4 - meaning the forth number in the ascending sequence..... sorry, was rushed when I jotted down that formula.
Join our Folding team: DeveloperBarn Folding
-----------------------------------
• Folding Stats - Stanford University
• Folding Stats - Extreme Over-Clocking
• Folding Stats - Kakao Stats
• Folding Stats - Xtreme CPU
-----------------------------------
:-) I figured it was either that, or you were relaxing with your second martini when you wrote it! :-)
question = 2B || !2B
lol, well, if I could have martinis at work, then it would be a lot less stressful these days, lol.
Join our Folding team: DeveloperBarn Folding
-----------------------------------
• Folding Stats - Stanford University
• Folding Stats - Extreme Over-Clocking
• Folding Stats - Kakao Stats
• Folding Stats - Xtreme CPU
-----------------------------------
Bookmarks