List box with available queries question

I have a list box control on a form and want the list box to display all the 
queries within the database. The following code is what I have so far but it 
does not work. Any help is appreciated.

SELECT [Name] FROM MSysObjects WHERE [TYPE] = 5 and LEFT([Name],1) <> "-" 
ORDER BY [Name];
0
Utf
4/21/2010 5:18:06 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
686 Views

Similar Articles

[PageSpeed] 17

"Billy B" <BillyB@discussions.microsoft.com> wrote in message 
news:F47BB77B-7B66-4860-8954-F4FE32FE7C3C@microsoft.com...
>I have a list box control on a form and want the list box to display all 
>the
> queries within the database. The following code is what I have so far but 
> it
> does not work. Any help is appreciated.
>
> SELECT [Name] FROM MSysObjects WHERE [TYPE] = 5 and LEFT([Name],1) <> "-"
> ORDER BY [Name];


It shouldn't be names starting with "-" that you exclude; it should be names 
starting with "~":

    SELECT [Name] FROM MSysObjects
    WHERE [TYPE] = 5 And LEFT([Name],1) <> "~"
    ORDER BY [Name];


-- 
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

0
Dirk
4/21/2010 5:46:39 PM
Reply:

Similar Artilces:

Combining an update query with a parameter query
I wanted to know how you can update data in a table using the update query and a parameter query. How did you want to run this update query? In query design, you can just put your parameter in the query. To run it programmatically, you can then use RunSQL in a macro or code. A better programmatic approach might be to build the SQL statement in code, concatenating the parameter value into the string. Then Execute the string itself: you don't need a saved query. The advantage is that you know whether it worked or not. Here's an example: Action queries: suppressing dialogs, whi...

XmlWriter newbie question
I'm trying, for the first time, to write XML to a string that will be sent out to a web service. According to the docs I have found... An XmlWriter needs a XmlTextWriter that needs a StreamWriter that needs a stream. (is it really this hard?) So I'm defining... System.IO.Stream astream; TextWriter myw = new StreamWriter(astream); <--this says astream is an unassigned variable XmlTextWriter mytw = new XmlTextWriter(myw); so it won't compile because it says astream is not defined. Are there any examples anywhere on how to write xml to a string, or a stream? -- Regards,...

combo boxes and colours
How do i set the color of a combo box listing different to the actual field cotnents color when i click the combo box button., i wnat the listing of chocies to be a differnt color to the original field content? Pat Put focus on the combo, go to format -> conditional formatting. In the first combo change the value to "field has focus", and then change the background color. "Patrick" wrote: > How do i set the color of a combo box listing different to the actual field > cotnents color when i click the combo box button., i wnat the listing of > ch...

Template Question
I'm making a listing of employees and various detals. For 'better' readability, I've prepared a template of alteranting rows of white and Light blue and a bunch of headers and saved it as a template in the template folder. Since the listing is an ongoing thing with regular updates, I find the need to sort the entries alphabetically(Usually by name) My problem is, the alternating color arrangement gets all messed up when run the 'sort' function. Is there a way I can keep the templates from getting messed up? -- Bahahahah! Hi Logicallystupid, U can use condit...

not in list event procedure
Please i need anot in list event procedure to help me update a table A with values i need to add. i.e i have form F which updates data in table T no probs. The control source is ok bu i reset the rowsource to a list in Table A. no probs. however i need Table A to add any new data that i may have to put on the list. Deron Here some that I used to an aiport code to a tbl_cities when the code that entered was not in the drop down list. I also used the GOT FOCUS event of the drop down to update the list with the new entry see coding below. Private Sub select_port_NotInList(NewData As ...

How do I produce a mailing address list in excel in comma format?
I am trying to send a mailing list to another business. I was asked to send it in excel and in comma format. How can I do this? Hi save your file as '*.csv' file -- Regards Frank Kabel Frankfurt, Germany "frojeff" <frojeff@discussions.microsoft.com> schrieb im Newsbeitrag news:827653C1-2F5C-40A2-9517-26CAA1C162D6@microsoft.com... > I am trying to send a mailing list to another business. I was asked to send > it in excel and in comma format. How can I do this? File|SaveAs and look for "CSV (comma delimited)(*.csv)" Each worksheet needs to be saved ...

Ultimate Basic question: What exactly IS publisher?
Okay, okay, I should know. But my wife is considering getting Publisher, and has previously worked with Word for text things, and sometimes with--gasp--Print Shop to produce basic graphics-based things like cards and posters. But what does Publisher do that Word doesn't? And does it do anything like a Print Shop type program, or is it something completely different? Word or Publisher? Use Crabby's special recipe to decide http://office.microsoft.com/en-us/help/HA101757591033.aspx Publisher 2007 Help and How-to http://officebeta.iponet.net/en-us/publisher/FX100649111033.aspx --...

text boxes
Hi all, I have a textbox within a userform that displays a value. I don't want any users to be able to edit this information. How do I go about this? Thanks in advance Dawna Set the "enabled" property to false. "Dawna" <Dawna@discussions.microsoft.com> wrote in message news:165BADFA-E792-4245-B573-2DD5B4B998CA@microsoft.com... > Hi all, > > I have a textbox within a userform that displays a value. I don't want any > users to be able to edit this information. How do I go about this? > > Thanks in advance > Dawna ...

Database is not listed in ODBC to default
Hi! I am trying to create a ODBC and default the Database in order for this ODBC to use in Crysral Reports, but I could see all Databases except the one I am looking for. I am using Windows Authentication and Namedpipes in the settings and necessary access has been given in SQL for this Windows user. I've tried even creating a new ODBC, it doesn't show the database that I'm looking for. Does any one experienced this before? Regards, Venkata N M Punugu If you are using Windows authentication, make sure the Windows user is added to the database. -- Charles Allen, MVP ...

Query/Expression Help Required!
Hello, i would appreciate any help in regards to the problem i am having. I will try and explain it to the best of my ability (im a newbie to Access 2000) Here is a snipt of the information i have extracted via a query. I have been able to work out Duration via a calculation. "Agent Pin" "Start Time" "AUX Name" "End Time" "Duration" "7015" "13:45:21" "After Call Work" "13:54:18" "537" "7015" "14:30:25" "After Call Work" "14:31:03" &...

Dialog box dynamic text
Hi, I've created a dialog box in Excel 2000, and I'm wondering if it's possible to have text in the dialog box which changes according to a specific cell in a worksheet?!? Thanks, Dan. -- Voodoodan ------------------------------------------------------------------------ Voodoodan's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=597 View this thread: http://www.excelforum.com/showthread.php?threadid=397961 If you're using Excel 2000 you should be using a userform rather than a dialog sheet. but you can have dynamic text in a dialog sheet di...

Where condition on a query in VBA
Hey there, Is it possible to have a where condition on a query in VBA? I am opening a recordset based on my query and wanted to add a where condition on the product type as we have many products. So here is my statement: Set rs = CurrentDb.OpenRecordset("qryPromotions", dbOpenDynaset, dbSeeChanges) I want to add "where ProdType = DI" Then after I am done the processing needed for this recordset, I want to open another one, based on the same query, but for a different ProdType. I don't want to have to create 10 different queries for 10 different ProdTypes, ...

General design question
hi! i'd like to design a class - let's call it CDrawObject - that is able to contain some data and draw itself. furthermore i'd like to have a class CDrawMultiObject that is derived from CDrawObject and can contain objects of type CDrawObject. i imagine to have the following situation: CDrawMultiObject -> base object (i.e. an object manager ) CDrawObject -> first element CDrawObject -> secound element CDrawMultiObject -> third element CDrawObject -> first element CDrawObject...

Get a list of files on network drive
I have a slight problem getting a list of files that exist on a network drive. I have two ways of doing it that are both slow (~10 minutes). I am only interested in one folder and not subfolders and there are only about 5,000 files in this folder. At a command prompt with a dir command the list of flies is displayed in less than 10 seconds. when I add the switch to write to a text file it takes about 10 minutes using. dir /b >filelisting.txt I also tried putting this in a bat file on the network drive but it still runs locally using cmd.exe So I tried in VB using this code which takes ...

Randomly selecting items from a list given their statistical likelihood
I have one solution, but it's rather cumbersome. I could create a lis 10,000 long with each unique item maintaining its relative percentag (to 4 decimal places) then putting =RAND() and selecting the highes number for each selection (60 in one of my cases) then run thi several hundred more times for an adequate sample size on which t _begin_ my analysis. Initially I figured I could simply multiply percentage of occurrence b a rand() number and take the maximum there 60 times repeatedly. Howeve it quickly became evident that I was dually weighted by the percentag (i.e. the ratio of th...

Excel Data Connections to Access Queries: Limits?
I have an Access 2007 database with data connections to: + Sharepoint Lists + SMS SQL tables/views I've written Access queries that use tables from those data connections. I want to use Excel to connect to those queries in the Access database to run various reports (such as charts, lists, etc...) However, I'm having 2 problems: 1) In Excel, when I go to Data / Get External Data / From Access, I cannot see all of the queries listed in the Access Database. 2) The queries I do see only return a small subset of records. (I've tested the query within Access, and I should get 17...

List of PDK users, Managers, Supervisors
I've searched in PDK and BP and can't find a report, or query that lists my PDK employees and their supervisor/manager. Does any such thing exist? ...

Text box hover
I have problem when trying to drag & drop cell with date formatted dd-mmm-yy in Excel spreadsheet. A 'Text box' hovers at mouse pointer when trying to access cell w date entry, which makes it a hit or miss whether I select cell or generate a new Text Box. Any suggestions would be appreciated. This does not happen on cells that contain, formulas, general text, or data. Thnak You Slimone ...

question on OnNcPaint #2
hi, I am trying to paint the border around the main frame black. This is my current code void CMainFrame::OnNcPaint() { MSG &msg = AfxGetThreadState()->m_lastSentMsg; HRGN hRgn = (HRGN)msg.wParam; CRect rcWin; // window rect GetWindowRect(&rcWin); rcWin.OffsetRect(-rcWin.left, -rcWin.top); CWindowDC dcWin(this); CBrush brFrame(RGB(0,0,0)); CRect finalRect; CRect clntRect; m_Client.GetWindowRect(clntRect); ScreenToClient(clntRect); CRect dockRect; m_Dock->GetWindowRect(dockRect); ScreenToClient(dockRect); ::Unio...

Newbie question / plug in a value for a cell based on a range for that value
Hey guys, New to Excel so sorry if this explanation isn't the clearest in terms of correct terminology. In one section of my spreadsheet I have a list of percentage values associated with numbers 1-20. For example #10 is listed with the percentage value of 38.4% in the cell next to it (O14 and P14). In another section of the spreadsheet I have a quick formula that I'd like to use these %'s based on what number (1-20) is entered. In my spreadsheet the % I want to use for this #10 is listed in P14 (38.4%). What can I plug into my formula so when I enter "10" is kno...

Lines in Outlook Calendar boxes by Time
Can someone tell me how to show lines in each Calender box..., by Month, by Day, by 1 hour Increments, from 7:30 A.M to 5:30 P.M., Monday thru Friday? Thanks! -- Catfish "Catfish" <Catfish@discussions.microsoft.com> wrote in message news:FC1CE63B-E769-4541-88FD-E1C38CDCB574@microsoft.com... > Can someone tell me how to show lines in each Calender box..., by Month, by > Day, by 1 hour Increments, from 7:30 A.M to 5:30 P.M., Monday thru Friday? Some views are timed and some are not. Day and Week views will show the time scale. The Month view will not. ...

Combo box in sub-form
To John W Vinson: Any chance of an answer to my previous question, as follows? I really would appreciate your help; you're my last hope! > On Sun, 29 Nov 2009 12:21:01 -0800, Chris <Chris@discussions.microsoft.com> > wrote: > > >I have a Track Artists table with field headings: Track Artist ID, Track > >Artist, Recording ID & Track ID. There are 3 names entered. > >When I click on a Track Artist field in the Sub-forn, a down arrow appears. > >If I click on the arrow a drop-down list appears but it is empty. When I > >double clic...

A Simple Question
How can I set the password in Excel so that no one can view the contents? I tried the password setting, and its only protecting from viewing. I checked the help and its saying --tools->general options-->etc, But I cannot find "general options" under tools menu. I'm using MS Office 2000 Thanks, Shafeek Khalidh Hi there, I also use Office 2000 and had a look around my own system. Open the worksheet you want to protect. Click File, Save As, with this box open, look along the top to the right of the dialogue box, it says "tools", click the arrow, it says &quo...

Can External Data(MsAccess) fill List Box?
Is this possible to create and can some one point me in the right direction to get started? Hi Matt one idea: - import your MS Access data with 'Data - Import external data - Import' on a separate sheet (can be hidden later on) - Create a defined name for this data source - use data validation (in combination with the defined name) to create a listbox HTh Frank Matt wrote: > Is this possible to create and can some one point me in the right > direction to get started? ...

Newbie question about Project Explorer window
When I look at the Project Explorer window, I can see all of my modules, but sometimes I also see a module called utility(UTILITY) containing entries like SOA_Biff, SOA_Txt, SOA_Rtf, Form_ZoomForm... etc. I didn't write these. What are they and are they needed? Also, why does it only appear on occasion? thank you -- cinnie ...