dbTalk Databases Forums  

Function As Rowsource In Listbox???

comp.databases.ms-access comp.databases.ms-access


Discuss Function As Rowsource In Listbox??? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Scott
 
Posts: n/a

Default Function As Rowsource In Listbox??? - 12-18-2004 , 03:29 PM






I have a function named MyFunction in a standard module that creates a
semi-colon delimited list. I want to use this list for the value list in a
listbox. I have the row source type property set to Value List. Can I use
the function, MyFunction, as the row source of the listbox? I have tried
=MyFunction and just MyFunction and in each case the listbox shows
=MyFunction or MyFunction like it is the first choice in the listbox rather
than showing the value list.

Thanks,

Scott



Reply With Quote
  #2  
Old   
Ken Snell
 
Posts: n/a

Default Re: Function As Rowsource In Listbox??? - 12-18-2004 , 03:33 PM






No. Use some event (such as the form's Load event) to run code that sets the
RowSorce to your function.

Me.ListBoxName.RowSource = MyFunction()


--

Ken Snell
<MS ACCESS MVP>

"Scott" <smiller (AT) nospam (DOT) please> wrote

Quote:
I have a function named MyFunction in a standard module that creates a
semi-colon delimited list. I want to use this list for the value list in a
listbox. I have the row source type property set to Value List. Can I use
the function, MyFunction, as the row source of the listbox? I have tried
=MyFunction and just MyFunction and in each case the listbox shows
=MyFunction or MyFunction like it is the first choice in the listbox
rather
than showing the value list.

Thanks,

Scott





Reply With Quote
  #3  
Old   
Scott
 
Posts: n/a

Default Re: Function As Rowsource In Listbox??? - 12-18-2004 , 05:51 PM



Ken,

Found this in the Help file but I can't get it to work ---
3 In the RowSourceType property box, enter the name of the function. Don't
put an equal sign before the function name.
4 Leave the RowSource property box blank.

Any comments?

Scott


"Ken Snell" <kthsneisllis9 (AT) ncoomcastt (DOT) renaetl> wrote

Quote:
No. Use some event (such as the form's Load event) to run code that sets
the
RowSorce to your function.

Me.ListBoxName.RowSource = MyFunction()


--

Ken Snell
MS ACCESS MVP

"Scott" <smiller (AT) nospam (DOT) please> wrote in message
news:Ii1xd.2833$9j5.161 (AT) newsread3 (DOT) news.pas.earthlink.net...
I have a function named MyFunction in a standard module that creates a
semi-colon delimited list. I want to use this list for the value list in
a
listbox. I have the row source type property set to Value List. Can I
use
the function, MyFunction, as the row source of the listbox? I have tried
=MyFunction and just MyFunction and in each case the listbox shows
=MyFunction or MyFunction like it is the first choice in the listbox
rather
than showing the value list.

Thanks,

Scott







Reply With Quote
  #4  
Old   
Douglas J. Steele
 
Posts: n/a

Default Re: Function As Rowsource In Listbox??? - 12-19-2004 , 05:57 AM



That's referring to a very specific call-back function that can be used.

See
http://msdn.microsoft.com/library/en...Parameters.asp
for details of what that function looks like.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Scott" <smiller (AT) nospam (DOT) please> wrote

Quote:
Ken,

Found this in the Help file but I can't get it to work ---
3 In the RowSourceType property box, enter the name of the function. Don't
put an equal sign before the function name.
4 Leave the RowSource property box blank.

Any comments?

Scott


"Ken Snell" <kthsneisllis9 (AT) ncoomcastt (DOT) renaetl> wrote in message
news:NeudnQ4YZc21P1ncRVn-tQ (AT) comcast (DOT) com...
No. Use some event (such as the form's Load event) to run code that sets
the
RowSorce to your function.

Me.ListBoxName.RowSource = MyFunction()


--

Ken Snell
MS ACCESS MVP

"Scott" <smiller (AT) nospam (DOT) please> wrote in message
news:Ii1xd.2833$9j5.161 (AT) newsread3 (DOT) news.pas.earthlink.net...
I have a function named MyFunction in a standard module that creates a
semi-colon delimited list. I want to use this list for the value list
in
a
listbox. I have the row source type property set to Value List. Can I
use
the function, MyFunction, as the row source of the listbox? I have
tried
=MyFunction and just MyFunction and in each case the listbox shows
=MyFunction or MyFunction like it is the first choice in the listbox
rather
than showing the value list.

Thanks,

Scott









Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.