Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: whats lower than or equals to if statement? <= not working :<

Geek News

whats lower than or equals to if statement? <= not working :<
h3llz 12/4/2008 9:34:01 AM
whats lower than or equals to if statement? <= not working :<
Re: whats lower than or equals to if statement? <= not working :<
"Brendan Reynolds" <brenreyn[ at ]discussions.microsoft.com> 12/4/2008 9:45:32 AM
"h3llz" <h3llz[ at ]discussions.microsoft.com> wrote in message
news:2256882B-2D46-4BA9-ADC5-0E979E923EEF[ at ]microsoft.com...
[Quoted Text]
> whats lower than or equals to if statement? <= not working :<


<= is the correct syntax for less then or equal to in VBA. Perhaps if you
post the actual code that's not working for you, some one may be able to see
what the problem is.

The data-type of the variables or constants being compared may make a
difference, too. Numbers or dates may not always compare the way you might
expect if they are being compared as text.

--
Brendan Reynolds

Re: whats lower than or equals to if statement? <= not working :<
h3llz 12/4/2008 10:01:03 AM

i = "1"
Do While i < (QryDat.Fields.Item("quantity") + 1)
cmoSelectQuantity.AddItem i
i = (i + 1)
Loop
i used the qrydat once, maybe can only use the same field once? first time
on vb =] (i know php, html etc)
"Brendan Reynolds" wrote:

[Quoted Text]
> "h3llz" <h3llz[ at ]discussions.microsoft.com> wrote in message
> news:2256882B-2D46-4BA9-ADC5-0E979E923EEF[ at ]microsoft.com...
> > whats lower than or equals to if statement? <= not working :<
>
>
> <= is the correct syntax for less then or equal to in VBA. Perhaps if you
> post the actual code that's not working for you, some one may be able to see
> what the problem is.
>
> The data-type of the variables or constants being compared may make a
> difference, too. Numbers or dates may not always compare the way you might
> expect if they are being compared as text.
>
> --
> Brendan Reynolds
>
Re: whats lower than or equals to if statement? <= not working :<
h3llz 12/4/2008 10:02:01 AM
thanks anyway, i found the problem, im using txtProductQuantity.Caption for
the highest point

"Brendan Reynolds" wrote:

[Quoted Text]
> "h3llz" <h3llz[ at ]discussions.microsoft.com> wrote in message
> news:2256882B-2D46-4BA9-ADC5-0E979E923EEF[ at ]microsoft.com...
> > whats lower than or equals to if statement? <= not working :<
>
>
> <= is the correct syntax for less then or equal to in VBA. Perhaps if you
> post the actual code that's not working for you, some one may be able to see
> what the problem is.
>
> The data-type of the variables or constants being compared may make a
> difference, too. Numbers or dates may not always compare the way you might
> expect if they are being compared as text.
>
> --
> Brendan Reynolds
>
Re: whats lower than or equals to if statement? <= not working :<
Bob Quintal <rquintal[ at ]sPAmpatico.ca> 12/6/2008 12:28:32 AM
=?Utf-8?B?aDNsbHo=?= <h3llz[ at ]discussions.microsoft.com> wrote in
news:0176126D-EE30-4781-934F-AB50237A7A83[ at ]microsoft.com:

[Quoted Text]
>
> i = "1"
> Do While i < (QryDat.Fields.Item("quantity") +
> 1)
> cmoSelectQuantity.AddItem i
> i = (i + 1)
> Loop
> i used the qrydat once, maybe can only use the same field once?
> first time on vb =] (i know php, html etc)

You are setting the value of the variable i to a string containing
one instance of ascii character 49, not the number 1.

change to i = 1

> "Brendan Reynolds" wrote:
>
>> "h3llz" <h3llz[ at ]discussions.microsoft.com> wrote in message
>> news:2256882B-2D46-4BA9-ADC5-0E979E923EEF[ at ]microsoft.com...
>> > whats lower than or equals to if statement? <= not working :<
>>
>>
>> <= is the correct syntax for less then or equal to in VBA.
>> Perhaps if you post the actual code that's not working for you,
>> some one may be able to see what the problem is.
>>
>> The data-type of the variables or constants being compared may
>> make a difference, too. Numbers or dates may not always compare
>> the way you might expect if they are being compared as text.
>>
>> --
>> Brendan Reynolds
>>



--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net