B
Bob H
I have this code in a form's load event and it lists or loads the
queries in a database into a combo box.
What I would like to do from this is when a query is selected from the
list, is for that said query to run.
Is there any way I can get this to happen?
Code:
Private Sub Form_Load()
Dim TblNames As String
TblNames = ""
Dim QM As String
QM = Chr(34)
Dim qry As AccessObject
For Each qry In CurrentData.AllQueries
TblNames = TblNames & QM & "Query: " & qry.Name & QM & ";"
Next qry
Me!tblqryCombo.RowSourceType = "Value List"
Me!tblqryCombo.RowSource = TblNames
Me!tblqryCombo.Value = Me!tblqryCombo.ItemData(0)
Me!tblqryCombo.LimitToList = True
End Sub
Thanks
queries in a database into a combo box.
What I would like to do from this is when a query is selected from the
list, is for that said query to run.
Is there any way I can get this to happen?
Code:
Private Sub Form_Load()
Dim TblNames As String
TblNames = ""
Dim QM As String
QM = Chr(34)
Dim qry As AccessObject
For Each qry In CurrentData.AllQueries
TblNames = TblNames & QM & "Query: " & qry.Name & QM & ";"
Next qry
Me!tblqryCombo.RowSourceType = "Value List"
Me!tblqryCombo.RowSource = TblNames
Me!tblqryCombo.Value = Me!tblqryCombo.ItemData(0)
Me!tblqryCombo.LimitToList = True
End Sub
Thanks