Hello guys,
I have a frmDailyReport wherein I have a unbound combo box, and a subform names subFrmQueries... I actually found this form here in Tek-Tips (I guess from MajP..) and found it useful, what it does is in the combobox, it will list down all queries in the database and show the results into the subform.. I find it very useful in our databases as this is a great replacement for having a button on a form to run different kinds of queries for users....
Anyway, the Combobox's (cmboQueries) Row Source is:
and the After Update Property is:
This form works great... the only problem I have though is that the name of the queries that shows up in the combobox are names that we use for our standard naming conventions of query names.. (having "qry" at the start of the name)... Is there a way though to rename the Query name in the combobox? So for example qryDailyReport will show as "Daily Report", qryInProcess will show as "In Process" etc...? some of the query names have only short names which only me (who created the queries/db) could only understand what it's for and if I put that in the combo box, the users will have a hard time what the query is for... that's why I was hoping there is a way to rename it just in the combobox?
I hope I was able to explain correctly... and please let me know if you have any questions...
I appreciate any help or guidance...
Thank you,
I have a frmDailyReport wherein I have a unbound combo box, and a subform names subFrmQueries... I actually found this form here in Tek-Tips (I guess from MajP..) and found it useful, what it does is in the combobox, it will list down all queries in the database and show the results into the subform.. I find it very useful in our databases as this is a great replacement for having a button on a form to run different kinds of queries for users....
Anyway, the Combobox's (cmboQueries) Row Source is:
Code:
SELECT DISTINCT MSysObjects.Name, MSysObjects.Type FROM MSysObjects WHERE (((MSysObjects.Name) Like "qryDailyReport*" Or (MSysObjects.Name)="qryInProcess" Or (MSysObjects.Name)="qryNeedToReview") AND ((MSysObjects.Type)=5));
and the After Update Property is:
Code:
Private Sub cmboQueries_AfterUpdate()
Me.subFrmQueries.SourceObject = "Query." & Me.cmboQueries
Me.subFrmQueries.Locked = True
End Sub
This form works great... the only problem I have though is that the name of the queries that shows up in the combobox are names that we use for our standard naming conventions of query names.. (having "qry" at the start of the name)... Is there a way though to rename the Query name in the combobox? So for example qryDailyReport will show as "Daily Report", qryInProcess will show as "In Process" etc...? some of the query names have only short names which only me (who created the queries/db) could only understand what it's for and if I put that in the combo box, the users will have a hard time what the query is for... that's why I was hoping there is a way to rename it just in the combobox?
I hope I was able to explain correctly... and please let me know if you have any questions...
I appreciate any help or guidance...
Thank you,