Re: Still need help incrementing a number after resetting it daily to 1



Sorry at one point there was a suggestion to use is as the default in the
text box. I have added in the before update and I am still confused. You
said that I must add something before the "=" I am not sure what to add.

If I add NPedana, I am afraid it will create a unending circle. I tried it
and nothing.

NPedana = Nz(DMax("NPedana", "Registro Entrata", "Day(Del)=Day(Date)"), 0) +
1

sorry if I am slow..
thank you for you patients.
michael



"Rick Brandt" <rickbrandt2@xxxxxxxxxxx> ha scritto nel messaggio
news:wW3Fe.357$IH2.69@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Michael wrote:
>> Rick Brandt was kind enough to give me the following code. I was
>> unable to follow up at the time and I did not repost there as I think
>> the thread is dead now.
>>
>> I have tried many variations on the code and cannot get it to work. I
>> am trying to reset the delivery number to 1 each morning and then to
>> increment as each order is added.
>>
>> This is the code he provided and below is my last attempt to get it
>> to work and a definition of the field names that I am using.
>>
>> When I try to add the code, I get the following error.
>>
>> "The expression you entered contains invalid syntax. You omitted an
>> operand or operator, you entered an invalid character or comma, or
>> you entered text without surrounding it in quotation marks."
>>
>>
>> =Nz(DMax("DailyDeliveryID","tblDailyDelivery","Day(CreatedDate) =
>> Day(Date)"), 0) + 1
>>
>> I have altered it to the following and not sure if I have done it
>> correctly
>>
>> =Nz(DMax("NPedana","Registro Entrata", "Day(Del) = Day(Date)"), 0) +
>> 1
>>
>> NPedana is the deliveryID
>> Registro Entrata is the name of the table where the ID is stored
>> Del is the date of the deliver that is in the table (created by using
>> a default of Date() in the properties box.(I was not sure if
>> CreatedDate was a function.
>>
>> thank you
>> Michael
>
> And where are you using the code? My suggestion was to use it in the
> BeforeUpdate event of the form and to test the NPedana for Null as a
> condition of doing the assignment.
>
> If that _is_ actually code then something has to be on the left side of
> the = as well. If you are just trying to use it as an expression in a
> TextBox that will not work.
>
>
> --
> I don't check the Email account attached
> to this message. Send instead to...
> RBrandt at Hunter dot com
>


.



Relevant Pages


Loading