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 Replies
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
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
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 13 Replies
View Related
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