Who Wants To Hear A Funny Story?

Jan 5, 2005

Ok, so while working on my program, i was trying to integrate inventory control with job ordering. i finally got it to work, but encountered a 2hr speedbump along the way. here's what happened:

i had 2 numbers: varQuantity and varStock (quantity being the amount to be ordered, stock being the amount in stock). i wanted code to run telling the orderer that we didn't have enough in stock if varQuantity > varStock. so, after entering test data (100 for stock, 200 for quantity) to see if the code would run, it didn't. going back through, i tried to see if i did something wrong, entered a > or < sign backwards, whatever. nothing.

If varQuantity > varStock Then
do this
else
do this
end if

it totally skipped this bit of code. i placed msgboxes between the steps to see where the problem was occurring, and only the boxes before and after the code functioned. i then placed a msgbox directly before the If statement with this prompt:

msgbox "varQuantity > varStock =" & varQuantity > varStock

the response? varQuantity > varStock = False. ooookkkkaaayyyy.... tried this:

msgbox varQuantity & ">" & varstock & "=" & varQuantity > varStock

guess what i got? you'll laugh. 200 > 100 = False. Now tell me what i'm supposed to do when my computer can't tell when 1 number is bigger than another? i tried different test data, i made sure that my fields were of the same data type, etc. nothing. how do i proceed?

well, the solution i came across worked, but i'd like to know why. varStock = varStock * 1. why does this work? maybe i'll never know. Stupid computers.

View Replies


ADVERTISEMENT

Small, Probably The Most Basic Question You'll Ever Hear

Dec 22, 2005

Hey, I'm doing Computing as an A-Level and we have project to do over Christmas and I need some small help writing the queries.

Basically I have to do an Examination's Board Database. It has to store the Candidates that are going for exams, what their Centre (School) Number is, what exam they're taking and so on. It has to be able to produce four reports.

One of these reports have to show every examination that is taken for a particular centre. I am using the variable "Ce_No" for Centre Number. And I have five different Centre Numbers being used. I want it so that when I open my Query it asks me to type in a centre number, then when I've typed it in and clicked "ok" it will show me every exam being taken by people in that centre. I'm hoping this makes sense.

In my query I have added all the information I want to use, I know I have to type something in for "Ce_No" in the "Criteria" bit, but I don't know what... I'm hoping this makes sense.

Basically, I want it so that when I type in a number, everything thing with that number as it's primary key comes up but nothing else.

Please help! :D

Thanks,

Daryl ^_^

View 5 Replies View Related

Funny Little Question.

Jun 16, 2005

Hi :) Just registered and was wondering if anyone could help me out.

I have a very simple table for which I am making a form. The table has two values:

'Week Number' (Number) and 'Period' (Number)

What I need is for the 'Period' field to increment with every new record created (easy enough) but when the week number changes I would like the 'Period' number to reset back to 1 in the following fashion:

Week||Period
...1.........1
...1.........2
...1.........3
...1.........4
...1.........5
...1.........6
...1.........7
...1.........8
...2.........1
...2.........2
...2.........3
...3.........1
...3.........2
...3.........3
...3.........4

etc...

If anyone can help me it would be greatly appreciated, thanks :)

Pob

View 2 Replies View Related

Funny DateDiff Parameter, Need Help

Apr 24, 2006

Hi:

I need to translate this VBA DateDiff into SAS and am not familiar with the "1>9,9"
I know "/" means divide but have never seen ""

Thanks for your help.
Steve

*Mth_1st_PNC: IIf(IsNull(DateDiff("d",DateDiff("d",[gest_age_days],[infantdob]),[calc_begin_pnc])/301),9, IIf(DateDiff("d",DateDiff("d",[gest_age_days],[infantdob]),[calc_begin_pnc])/301>9,9, IIf(DateDiff("d",DateDiff("d",[gest_age_days],[infantdob]),[calc_begin_pnc])/301<1,1,
DateDiff("d",DateDiff("d",[gest_age_days],[infantdob]),[calc_begin_pnc])/301)));

View 5 Replies View Related

Autonumber Doing Funny Things

Jan 24, 2007

Hello,

I just noticed something very strange - in a table of mine, when I create a new record with the form, the autonumber is an existing number. Say the last record had ID 400, then the "new" record is assigned an autonumber ID of 300.
Of course, record creation fails that way.
But with every attempt, the new autonumber moves one up, so eventually it'll start making unique numbers again.

Does anybody have an explanation for this odd behaviour?

View 7 Replies View Related

Funny Output On The Record Number Indicator

Jan 16, 2006

Hi all

basically i have implemented something in form that says record 1 of 5 etc

the way this is implemented is done straight into the text box on teh form ...


="Application " & [CurrentRecord] & " of " & IIf([NewRecord],[CurrentRecord],Count(*))


The problem with above implementation is that when adding a new record sometimes i get say record 3 of 2 instead of 3 of 3

somettimes its 3 of 3 but when scrolling back i get 2 of 2

any ideas how i can implement this in a stable manner??

thanks

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved