From: BobbyDazzler on

If Me!cboSelect.Column(3)

should have been

If Me!cboSelectCustomer.Column(3)


What a muppet! Sorry folks and thanks for the help!
From: Bob Quintal on
BobbyDazzler <david.a.mitchell(a)inbox.com> wrote in news:8f09b203-
5881-49ea-9861-18b8f11738ea(a)q23g2000yqd.googlegroups.com:

>> Where are you going wrong? do you want the long �list or the short
>> one?
>
> Give me the long one!
>
>> the short list is
>> 1) .Column(n) is ZERO-based, so your columns are 0,1,2 not 1,2,3
>
> Yeah, I know, there are four columns! 0,1,2,3
>
>> 2) you are using the literal -1 and 0 instead of True and False
>
> ok, have changed
>
>> 3) what is txtsaletype? the name implies a textbox, which should
be
>> prefixed with Me! or Form!Name!
>
> your right, it was in my app I retyped instead of copying and
pasting
>
>> 4) you are using multiple if-else blocks where only 1 is needed.
>>
>> If Me!cboSelect.Column(2) Then
>
> is there somthing missing on this line?

no actually, that is working code
Visual basic always reduces an IF statement to If Not False then
False is a constant which is 0. Any non 0 value is therefore True
Me!cboSelect.Column(2) = True gets evaluated and reduced to
Not False = Not False which is further evaluated to Not False.
but Me!cboSelect.Column(2) is already Not False, so writing it as I
have above saves 3 evaluations

>
>> � �Me!chkCustomerAcctHeld = True
>> � �Mew!txtsaletype = "CREDIT SALE"
>
> is this a typo?

yes, sorry. fingers faster thgan brain.
>
>> Else
>> � �Me!chkCustomerAcctHeld = False
>> � �Mew!txtsaletype = "CASH SALE"
>> End If
>>
> Tried with Me! and with True/False and without multiple ifs and
still
> doesn't work!
>
From your reply to yourself, I think you should go into the Visual
Basic Menu -> Tools -> Options -> Editor and check Require Variable
Declaration. That probably would have given you an error at compile
time.


--
Bob Quintal

PA is y I've altered my email address.