D
dhstein
I'm trying to set up a combobox with a list of my queries. I have code that
creates a string of each query separated by vbCRLF. I use this function as
the control source in my combobox and specify to use a valuelist. This
returns the string as a single line in the combo box, which is obviously not
what I want. Is it possible to use this method to populate the combobox? Do
I need to change the delimiter? (I tried ";") Any suggestions are
appreciated.
Public Function GetQueryList() As String
' List all the queries
Dim QryCount As Integer
Dim QryName As String
Dim QryPrefix As String
GetQueryList = " " & vbCrLf
For QryCount = 0 To CurrentDb.QueryDefs.Count - 1
QryName = CurrentDb.QueryDefs(QryCount).Name
QryPrefix = Left(QryName, 3)
If QryPrefix = "qry" Then
GetQueryList = GetQueryList & QryName & vbCrLf
End If
Next
End Function
creates a string of each query separated by vbCRLF. I use this function as
the control source in my combobox and specify to use a valuelist. This
returns the string as a single line in the combo box, which is obviously not
what I want. Is it possible to use this method to populate the combobox? Do
I need to change the delimiter? (I tried ";") Any suggestions are
appreciated.
Public Function GetQueryList() As String
' List all the queries
Dim QryCount As Integer
Dim QryName As String
Dim QryPrefix As String
GetQueryList = " " & vbCrLf
For QryCount = 0 To CurrentDb.QueryDefs.Count - 1
QryName = CurrentDb.QueryDefs(QryCount).Name
QryPrefix = Left(QryName, 3)
If QryPrefix = "qry" Then
GetQueryList = GetQueryList & QryName & vbCrLf
End If
Next
End Function