PC Review


Reply
Thread Tools Rate Thread

ComboBox List - Invalid Argument????

 
 
Minitman
Guest
Posts: n/a
 
      1st Jun 2008
Greetings,

I am trying to set a CheckBox to either true or false depending on if
the value on row 1 column 81 is "X" or empty

I have this statement in a sub:

___________________________________________________________
....
If ComboBox1.List(ComboBox1.ListIndex, 80) = vbNullString Then
.....
___________________________________________________________

That keeps coming up with an invalid argument error. I don't
understand, the elements of the argument appears to be correct.

It's supposed to see if the value on row 1 in the 81st column of the
ComboBox List is empty or not (a checkbox loaded it with an "X" or ""
when the record was created)

Debug shows the value of the ListIndex as 1 which is correct.

Can anyone advise as to where or what could be causing this problem?

Any help will be appreciated.

Thanks for looking at my question.

-Minitman
 
Reply With Quote
 
 
 
 
Doug Glancy
Guest
Posts: n/a
 
      1st Jun 2008
Minitman,

I don't think this is the answer, but wouldn't row 1 of your combobox have a
ListIndex of 0?

I can't duplicate your problem though.

Doug

"Minitman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Greetings,
>
> I am trying to set a CheckBox to either true or false depending on if
> the value on row 1 column 81 is "X" or empty
>
> I have this statement in a sub:
>
> ___________________________________________________________
> ...
> If ComboBox1.List(ComboBox1.ListIndex, 80) = vbNullString Then
> ....
> ___________________________________________________________
>
> That keeps coming up with an invalid argument error. I don't
> understand, the elements of the argument appears to be correct.
>
> It's supposed to see if the value on row 1 in the 81st column of the
> ComboBox List is empty or not (a checkbox loaded it with an "X" or ""
> when the record was created)
>
> Debug shows the value of the ListIndex as 1 which is correct.
>
> Can anyone advise as to where or what could be causing this problem?
>
> Any help will be appreciated.
>
> Thanks for looking at my question.
>
> -Minitman



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      1st Jun 2008
Does your ComboBox have 80 columns? If the ComboBox1.ListIndex = 1 Then the
statement ComboBox1.List(ComboBox1.ListIndex, 80) would be trying to return
the combo box value for row 1, column 80 of the combo box list, not the
worksheet.

"Minitman" wrote:

> Greetings,
>
> I am trying to set a CheckBox to either true or false depending on if
> the value on row 1 column 81 is "X" or empty
>
> I have this statement in a sub:
>
> ___________________________________________________________
> ....
> If ComboBox1.List(ComboBox1.ListIndex, 80) = vbNullString Then
> .....
> ___________________________________________________________
>
> That keeps coming up with an invalid argument error. I don't
> understand, the elements of the argument appears to be correct.
>
> It's supposed to see if the value on row 1 in the 81st column of the
> ComboBox List is empty or not (a checkbox loaded it with an "X" or ""
> when the record was created)
>
> Debug shows the value of the ListIndex as 1 which is correct.
>
> Can anyone advise as to where or what could be causing this problem?
>
> Any help will be appreciated.
>
> Thanks for looking at my question.
>
> -Minitman
>

 
Reply With Quote
 
Minitman
Guest
Posts: n/a
 
      1st Jun 2008
Hey JLGWhiz,

Thanks for the reply;

Good call. I missed one spot when I added an additional column to my
source worksheet. I forgot to expand the RowSource from column CB to
CC. With your hint I found it and now that section is working again

Thanks.

-Minitman



On Sun, 1 Jun 2008 10:26:00 -0700, JLGWhiz
<(E-Mail Removed)> wrote:

>Does your ComboBox have 80 columns? If the ComboBox1.ListIndex = 1 Then the
>statement ComboBox1.List(ComboBox1.ListIndex, 80) would be trying to return
>the combo box value for row 1, column 80 of the combo box list, not the
>worksheet.
>
>"Minitman" wrote:
>
>> Greetings,
>>
>> I am trying to set a CheckBox to either true or false depending on if
>> the value on row 1 column 81 is "X" or empty
>>
>> I have this statement in a sub:
>>
>> ___________________________________________________________
>> ....
>> If ComboBox1.List(ComboBox1.ListIndex, 80) = vbNullString Then
>> .....
>> ___________________________________________________________
>>
>> That keeps coming up with an invalid argument error. I don't
>> understand, the elements of the argument appears to be correct.
>>
>> It's supposed to see if the value on row 1 in the 81st column of the
>> ComboBox List is empty or not (a checkbox loaded it with an "X" or ""
>> when the record was created)
>>
>> Debug shows the value of the ListIndex as 1 which is correct.
>>
>> Can anyone advise as to where or what could be causing this problem?
>>
>> Any help will be appreciated.
>>
>> Thanks for looking at my question.
>>
>> -Minitman
>>


 
Reply With Quote
 
Minitman
Guest
Posts: n/a
 
      1st Jun 2008
Hey Doug,

Thanks for the reply.

I was mistaken on the row (index number). I was coming from row 1
going to row 2.

JLGWhiz brought up an issue that I thought had been addressed quite a
while ago, I just forgot to change the last column in my row source
code (I added a column and missed this one change). It was CB and
should have been changed to CC.

-Minitman

On Sun, 1 Jun 2008 09:54:04 -0700, "Doug Glancy"
<(E-Mail Removed)> wrote:

>Minitman,
>
>I don't think this is the answer, but wouldn't row 1 of your combobox have a
>ListIndex of 0?
>
>I can't duplicate your problem though.
>
>Doug
>
>"Minitman" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> Greetings,
>>
>> I am trying to set a CheckBox to either true or false depending on if
>> the value on row 1 column 81 is "X" or empty
>>
>> I have this statement in a sub:
>>
>> ___________________________________________________________
>> ...
>> If ComboBox1.List(ComboBox1.ListIndex, 80) = vbNullString Then
>> ....
>> ___________________________________________________________
>>
>> That keeps coming up with an invalid argument error. I don't
>> understand, the elements of the argument appears to be correct.
>>
>> It's supposed to see if the value on row 1 in the 81st column of the
>> ComboBox List is empty or not (a checkbox loaded it with an "X" or ""
>> when the record was created)
>>
>> Debug shows the value of the ListIndex as 1 which is correct.
>>
>> Can anyone advise as to where or what could be causing this problem?
>>
>> Any help will be appreciated.
>>
>> Thanks for looking at my question.
>>
>> -Minitman

>


 
Reply With Quote
 
Doug Glancy
Guest
Posts: n/a
 
      1st Jun 2008
Minitman,

That makes sense. That's a lot of columns! If it were me, I might name
the crucial column (or the whole area), and have a function in my code to
return the column number, and then use that number in the combobox code.
Then the next time you add a column your code will still work.

cheers,

Doug

"Minitman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hey Doug,
>
> Thanks for the reply.
>
> I was mistaken on the row (index number). I was coming from row 1
> going to row 2.
>
> JLGWhiz brought up an issue that I thought had been addressed quite a
> while ago, I just forgot to change the last column in my row source
> code (I added a column and missed this one change). It was CB and
> should have been changed to CC.
>
> -Minitman
>
> On Sun, 1 Jun 2008 09:54:04 -0700, "Doug Glancy"
> <(E-Mail Removed)> wrote:
>
>>Minitman,
>>
>>I don't think this is the answer, but wouldn't row 1 of your combobox have
>>a
>>ListIndex of 0?
>>
>>I can't duplicate your problem though.
>>
>>Doug
>>
>>"Minitman" <(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed)...
>>> Greetings,
>>>
>>> I am trying to set a CheckBox to either true or false depending on if
>>> the value on row 1 column 81 is "X" or empty
>>>
>>> I have this statement in a sub:
>>>
>>> ___________________________________________________________
>>> ...
>>> If ComboBox1.List(ComboBox1.ListIndex, 80) = vbNullString Then
>>> ....
>>> ___________________________________________________________
>>>
>>> That keeps coming up with an invalid argument error. I don't
>>> understand, the elements of the argument appears to be correct.
>>>
>>> It's supposed to see if the value on row 1 in the 81st column of the
>>> ComboBox List is empty or not (a checkbox loaded it with an "X" or ""
>>> when the record was created)
>>>
>>> Debug shows the value of the ListIndex as 1 which is correct.
>>>
>>> Can anyone advise as to where or what could be causing this problem?
>>>
>>> Any help will be appreciated.
>>>
>>> Thanks for looking at my question.
>>>
>>> -Minitman

>>

>



 
Reply With Quote
 
Minitman
Guest
Posts: n/a
 
      1st Jun 2008
Hey Doug,

I tried that originally, but the limitations of calling a dynamic
named range from a different workbook was causing problems. Due to
the size of my customer list (81 columns by 3000 rows) I only had
access to the first ~2300 customer in the list. So I defined the
range going into the ComboBox RowSource. That is where the oversight
occurred.

Would you be willing to talk off group about some of the other
problems I am having with this workbook rewrite?

If so, my email should be visible.

-Minitman


On Sun, 1 Jun 2008 12:00:50 -0700, "Doug Glancy"
<(E-Mail Removed)> wrote:

>Minitman,
>
>That makes sense. That's a lot of columns! If it were me, I might name
>the crucial column (or the whole area), and have a function in my code to
>return the column number, and then use that number in the combobox code.
>Then the next time you add a column your code will still work.
>
>cheers,
>
>Doug
>
>"Minitman" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> Hey Doug,
>>
>> Thanks for the reply.
>>
>> I was mistaken on the row (index number). I was coming from row 1
>> going to row 2.
>>
>> JLGWhiz brought up an issue that I thought had been addressed quite a
>> while ago, I just forgot to change the last column in my row source
>> code (I added a column and missed this one change). It was CB and
>> should have been changed to CC.
>>
>> -Minitman
>>
>> On Sun, 1 Jun 2008 09:54:04 -0700, "Doug Glancy"
>> <(E-Mail Removed)> wrote:
>>
>>>Minitman,
>>>
>>>I don't think this is the answer, but wouldn't row 1 of your combobox have
>>>a
>>>ListIndex of 0?
>>>
>>>I can't duplicate your problem though.
>>>
>>>Doug
>>>
>>>"Minitman" <(E-Mail Removed)> wrote in message
>>>news:(E-Mail Removed)...
>>>> Greetings,
>>>>
>>>> I am trying to set a CheckBox to either true or false depending on if
>>>> the value on row 1 column 81 is "X" or empty
>>>>
>>>> I have this statement in a sub:
>>>>
>>>> ___________________________________________________________
>>>> ...
>>>> If ComboBox1.List(ComboBox1.ListIndex, 80) = vbNullString Then
>>>> ....
>>>> ___________________________________________________________
>>>>
>>>> That keeps coming up with an invalid argument error. I don't
>>>> understand, the elements of the argument appears to be correct.
>>>>
>>>> It's supposed to see if the value on row 1 in the 81st column of the
>>>> ComboBox List is empty or not (a checkbox loaded it with an "X" or ""
>>>> when the record was created)
>>>>
>>>> Debug shows the value of the ListIndex as 1 which is correct.
>>>>
>>>> Can anyone advise as to where or what could be causing this problem?
>>>>
>>>> Any help will be appreciated.
>>>>
>>>> Thanks for looking at my question.
>>>>
>>>> -Minitman
>>>

>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Argument Bruce Microsoft Access 5 15th Nov 2008 02:08 AM
Invalid Argument =?Utf-8?B?U1dNYWdpYw==?= Microsoft Access Queries 5 8th Mar 2007 12:34 PM
Invalid Argument Eric Microsoft Access Forms 1 15th Aug 2006 10:03 PM
Invalid Argument =?Utf-8?B?U2hhcmtieXRl?= Microsoft Access 1 15th Jun 2006 10:20 PM
Invalid Argument Toni Microsoft Access 2 2nd Feb 2004 11:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:45 AM.