PC Review


Reply
Thread Tools Rate Thread

.Column(index as Long,[row])

 
 
tom
Guest
Posts: n/a
 
      29th Nov 2006
In an effort to write some visual basic code, as I was
typing away trying to get a form to open from a
list box, the visual basic program autocompleted
partially

..Column(index as Long,[row])

as soon as I typed the (

I have no idea what this means. Can anyone help me
here?


 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      29th Nov 2006
tom wrote:
> In an effort to write some visual basic code, as I was
> typing away trying to get a form to open from a
> list box, the visual basic program autocompleted
> partially
>
> .Column(index as Long,[row])
>
> as soon as I typed the (
>
> I have no idea what this means. Can anyone help me
> here?


If you have a ListBox with more than one column the Value property of the
ListBox will give you the value of the bound column (if MultiSelect is
disabled). To get any other column you use...

ListBoxName.Column(0)

....to get the first column and...

ListBoxName.Column(1)

....to get the second column, etc..

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
 
tom
Guest
Posts: n/a
 
      29th Nov 2006

"Rick Brandt" <(E-Mail Removed)> wrote in message
news:9Rnbh.31463$(E-Mail Removed)...
> tom wrote:
>> In an effort to write some visual basic code, as I was
>> typing away trying to get a form to open from a
>> list box, the visual basic program autocompleted
>> partially
>>
>> .Column(index as Long,[row])
>>
>> as soon as I typed the (
>>
>> I have no idea what this means. Can anyone help me
>> here?

>
> If you have a ListBox with more than one column the Value property of the
> ListBox will give you the value of the bound column (if MultiSelect is
> disabled). To get any other column you use...
>
> ListBoxName.Column(0)
>
> ...to get the first column and...
>
> ListBoxName.Column(1)
>
> ...to get the second column, etc..
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>


Thank you, is the Value property the Default Value?


 
Reply With Quote
 
Rick Brandt
Guest
Posts: n/a
 
      30th Nov 2006
"tom" <(E-Mail Removed)> wrote in message
news:zJobh.17066$(E-Mail Removed)...
> Thank you, is the Value property the Default Value?


Yes. I also realized that I didn't discuss the second argument. If you only
supply the column argument then you get the row that is currently selected. The
second argument allows you to get the values from other rows. For example, the
value for the third column in the second row would be retrieved with...

ListBoxName.Column(2,1)



--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com



 
Reply With Quote
 
Van T. Dinh
Guest
Posts: n/a
 
      30th Nov 2006
If your question is:

Is the Value the default *Property* (of the ListBox)?

then the answer is yes. However, the ListBox also has the Property "Default
Value" which is a different Property.

--
HTH
Van T. Dinh
MVP (Access)



"tom" <(E-Mail Removed)> wrote in message
news:zJobh.17066$(E-Mail Removed)...
>
>
> Thank you, is the Value property the Default Value?
>



 
Reply With Quote
 
Tom
Guest
Posts: n/a
 
      30th Nov 2006
I cant seem to find value amongst the list of
properties, only the Default Value.


"Van T. Dinh" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> If your question is:
>
> Is the Value the default *Property* (of the ListBox)?
>
> then the answer is yes. However, the ListBox also has the Property "Default
> Value" which is a different Property.
>
> --
> HTH
> Van T. Dinh
> MVP (Access)
>
>
>
> "tom" <(E-Mail Removed)> wrote in message
> news:zJobh.17066$(E-Mail Removed)...
> >
> >
> > Thank you, is the Value property the Default Value?
> >

>
>



 
Reply With Quote
 
Jessie
Guest
Posts: n/a
 
      30th Nov 2006

"tom" <(E-Mail Removed)> a következőket írta üzenetében
news:yNnbh.17042$(E-Mail Removed)...
> In an effort to write some visual basic code, as I was
> typing away trying to get a form to open from a
> list box, the visual basic program autocompleted
> partially
>
> .Column(index as Long,[row])
>
> as soon as I typed the (
>
> I have no idea what this means. Can anyone help me
> here?
>


 
Reply With Quote
 
Van T. Dinh
Guest
Posts: n/a
 
      30th Nov 2006
I guess you looked at the Properties window of the ListBox?

The Value Property does not exist in DesignView and the Properties window is
mainly used in DesignView and therefore, the Value Property is not included
in this window. It only exists in FormView, i.e. when you are running the
Form and in fact, it is the default Property. "Default" here means that if
you simply use, for example:

MyVariable = Me.ListBox

Access VBA will interpret that you mean (in most cases):

MyVariable = Me.ListBox.Value

Thus "default" here means that you don't have to explicitly use the word
"Value" to refer to the Value of the ListBox.

If you know how to use the ObjectBrowser in the IDE (i.e. the code window),
you will see that Value is a Property of the ListBox object with a blue dot
in its icon to signify that it is the default Property.

OTOH, "Default Value" means that if you use the Form to enter a new Record,
the row that corresponds to the value you set as DefaultValue will be
automatically highlighted and unless you change the selection in the bound
ListBox to another row, this value will be stored in the Table when the
Record is saved.

--
HTH
Van T. Dinh
MVP (Access)



"Tom" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I cant seem to find value amongst the list of
> properties, only the Default Value.
>
>
> "Van T. Dinh" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> If your question is:
>>
>> Is the Value the default *Property* (of the ListBox)?
>>
>> then the answer is yes. However, the ListBox also has the Property
>> "Default
>> Value" which is a different Property.
>>
>> --
>> HTH
>> Van T. Dinh
>> MVP (Access)
>>
>>
>>
>> "tom" <(E-Mail Removed)> wrote in message
>> news:zJobh.17066$(E-Mail Removed)...
>> >
>> >
>> > Thank you, is the Value property the Default Value?
>> >

>>
>>

>
>



 
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
Display index of column headers in column A MZ Microsoft Excel Misc 9 17th Jan 2010 06:35 PM
Column label based on column index igorek Microsoft Excel Programming 2 15th Dec 2007 12:57 AM
make index for a long report =?Utf-8?B?bWhtYWlk?= Microsoft Access Reports 1 2nd Jul 2007 09:24 PM
Using an Index by Column Headings instead of Column Numbers =?Utf-8?B?U2VhbiBCaXNob3A=?= Microsoft Excel New Users 2 21st Nov 2006 09:38 PM
How do I get the column index of a datagrid from the column title? Moondog Microsoft VB .NET 8 23rd Sep 2004 02:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:41 AM.