Populationg combo

  • Thread starter Thread starter Ig
  • Start date Start date
I

Ig

Hi
How to populate combo with names of all forms in the project?
Thanks
 
You can use CurrentProject.AllForms collection in your
Form_Load event:

Dim strForms As String
Dim frm As AccessObject
cbo.RowSourceType = "Value List"
For Each frm in CurrentProject.AllForms
strForms = strForms & ";" & frm.Name
Next
If Len(strForms) > 1 Then
cbo.RowSource = Mid(strForms, 2)
End If

HTH
 
Thanks Sergey

Sergey Poberezovskiy said:
You can use CurrentProject.AllForms collection in your
Form_Load event:

Dim strForms As String
Dim frm As AccessObject
cbo.RowSourceType = "Value List"
For Each frm in CurrentProject.AllForms
strForms = strForms & ";" & frm.Name
Next
If Len(strForms) > 1 Then
cbo.RowSource = Mid(strForms, 2)
End If

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top