Textbox AllForm

wizcow

Registered User.
Local time
Today, 13:21
Joined
Sep 22, 2001
Messages
236
I am trying to get a textbox to list all the forms in the database.

Can I do this!

Tom
 
Something along these lines should work - I can't recall the exact code at the moment.

Code:
Dim strForms As String
Dim f As Form
For Each f In Forms
   strForms = strForms & f.Name & vbCrLf
Next
Me.txtYourTextBox = strForms
 
You could use a public function like this for getting all the forms in the database forms container.

Code:
Public Function GetAllForms() As String
  Dim objDoc As Variant
  Dim strAllForms As String
  
  For Each objDoc In DBEngine(0)(0).Containers("Forms").Documents
    strAllForms = strAllForms & objDoc.Name & vbCrLf
  Next objDoc
  
  If Len(strAllForms) > 0 Then
    strAllForms = Left$(strAllForms, Len(strAllForms) - Len(vbCrLf))
  End If
  GetAllForms = strAllForms
End Function
You have to set a reference to the DAO-Library if your version is > A97.
 

Users who are viewing this thread

Back
Top Bottom