Listbox Help

R

Richard

Hi,

I would like to populate my listbox with all the forms in my current data
base. I have used them for querys / tables, but can't figure out how to list
my forms.
Thanks Richard
 
S

strive4peace

Hi Richard,

'~~~~~~~~~~~~~~~~~~~

dim r as dao.recordset

dim s as string _
mList as string

s = "SELECT Name FROM MsysObjects WHERE [Type] = -32768"

set r = currentdb.openrecordset(s, dbopensnapshot)
mList = ""
do while not r.eof
mList = mList & "'" & r!Name & "';"
r.movenext
loop

r.close
set r = nothing

me.controlname.rowsource = mList
me.controlname.requery

'~~~~~~~~~~~~~~~~~~~

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
R

RoyVidar

Richard said:
Hi,

I would like to populate my listbox with all the forms in my
current data base. I have used them for querys / tables, but can't
figure out how to list my forms.
Thanks Richard

You could use a rowsource of

SELECT [Name] FROM MsysObjects WHERE [Type]= -32768 ORDER BY [Name]

for your listbox. Here's a bit of info with regards to different
methods of populating a combo or list with *reports*
http://support.microsoft.com/kb/275563
 
Top