How to save a new saved query as a veriable?

PuddinPie

Registered User.
Local time
Today, 08:16
Joined
Sep 15, 2010
Messages
149
Hello,

This is an intresting one and I don't even know if it's possiable so please bear with me while I try to explain it in the best way.
I have a form with a combo box that list's a list of queries that are stored in a reflist table. The EU can choose one from the drop down list and open/run/modify it to there hearts content.
That work's. My issue is that I want to give them the ability to create a new one and upon saving it, it will show up in the combo box.
The reason I'm using a table and not a module to list my queries is because I don't want to list all of them, just some of them.
I was wondering if there was a way of, upon them saving the new query I could save that query name and add it as a new record in the table so they can see it in the dropdown box?

Thank you.
 
You are giving your users the power to create queries?? :eek: ;) It shouldn't be so.

Use the following as the Row Source of your combo box:
Code:
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Type)=5) AND ((Left([Name],1))<>"~"))
ORDER BY MSysObjects.Name;
 
Am I suppose to change any of that as it pertains to my database because when I put that in it was just blank?

Here is the module I was trying to use.

Function ListQueries() As String
Dim strList As String
Dim obj As AccessObject
For Each obj In CurrentData.AllQueries
If Not GetHiddenAttribute(acQuery, obj.Name) Then
strList = strList & ";" & obj.Name
End If
Next obj
If Not strList = "" Then
strList = Mid(strList, 2)
End If
ListQueries = strList
End Function
 
Where did you put the code?

Did you amend the Row Source Type, Column Count and Column Widths properties accordingly?

Did you also comment out your code as well?
 

Users who are viewing this thread

Back
Top Bottom