Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referring to Queries in a Group 1

Status
Not open for further replies.

ActMod

Technical User
Aug 25, 2003
45
US
I have grouped several Queries into a "Group" named "MktSgmts". How would I revise the below VBA Code such that it will only refer to those in the "MktSgmets" Group?

With CurrentData
For Each Qrys In .AllQueries
lstBox.AddItem Qrys.Name
Next Qrys
End With

Thank you for any help.

Jim

 


With CurrentData
For Each Qrys In .AllQueries
if mid$(Qrys.Name,1,8)= "MktSgmts" then
lstBox.AddItem Qrys.Name
end if
Next Qrys
End With

You can also use the Instr function, look in help file

 
I don't think my question was clear. The Queries that I am trying to access do not have the letters "MktSgmt" within their Names. Rather, I created a Group called "MktSgmt" (on the left hand side of the "Database" screen). I then "right-clicked" certain Queries and added them to the "MktSgmt" Group. This creates shortcuts in the "MktSgmt" Group that point to the real Queries but the names of the shortcuts appear to be identical to the real Queries. I am trying to access only those Queries for which I created the shortcuts that reside in the Group called "MktSgmt".

I hope that this makes some sense. Thank you for your help.

Jim
 
I don't see it listed in the AccessObject object in the Help file. That shows a listing of all the high level objects you can address. Your best bet would be to standardize the naming of your queries.
 
Thank you. I will go with your suggestion to standardize the names of my queries. Would have been nice to be able to isolate selected queries since I expect to be dealing with dozens of queries.

Thanks again.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top