Combo box filter before form opens

frmSearchType with cboType and cmdOpenForm which opens frmEntryEdit.  
frmEntryEdit uses cboEntryNum to allow user to select from the filtered 
records.
This is working correctly, however if no records fit the filter, I get an 
open frmEntryEdit, with no records in the cboEntryNum.  I would rather have a 
message box that states "No Data fits the criteria", than have frmEntry Edit 
open.  Is this possible?   
-- 
Teach me to fish!  Thanks for the help.
Pax, M
0
Utf
2/16/2010 4:54:02 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
672 Views

Similar Articles

[PageSpeed] 20

m stroup wrote:

>frmSearchType with cboType and cmdOpenForm which opens frmEntryEdit.  
>frmEntryEdit uses cboEntryNum to allow user to select from the filtered 
>records.
>This is working correctly, however if no records fit the filter, I get an 
>open frmEntryEdit, with no records in the cboEntryNum.  I would rather have a 
>message box that states "No Data fits the criteria", than have frmEntry Edit 
>open.

One way would be to use an If statement with a DLookup to
see if there is a match or not.  Then you can skip opening
the form.

Another way would be for the form's Load event to check its
RecordCount and Cancel the event if the count is 0.  In this
case the button's code probably should use error handling to
ignore the 2501 error.

-- 
Marsh
MVP [MS Access]
0
Marshall
2/16/2010 6:17:25 PM
Reply:

Similar Artilces:

advanced filter #6
here is the file: http://www.mytempdir.com/935740 First sorry for my english.... I have this code to insert letter "E" in column N of a sheet GAF only if the dates in column B of sheet GAF are into range DATAIN/DATAFIN use for test DATAIN=01/11/2005 DATAFIN =30/11/2005) Now, i want to use the same code to insert "E" in column N if the range of dates is naturally into range DATAIN/DATAFIN but if the value into column H is the same present into column B of sheet CORPORATE. So, insert in column "N" of sheet GAF the letter "E" in cells N2, N49, N50, N51...

office 2000 [excel] cannot open previously OK file. Help
When trying to open a Microsoft Excel Work Sheet that I had accessed modified and saved to only yesterday [Office 2000] a window pops up with: "name.xls cannot be accessed. The file may be resd-only, or you may be trying toaccess a read only location. Or, the server the document is stored on may not be responding." Older files stored on the same mediums ;HD, Flash memory or 3.5in. diskette are accessed with no problem. This is on a network drive? ...

Cannot open Excel attachment from e-mail when Excel is already ope
This is driving me crazy. If I already have Excel open (with or with out a spreadsheet open) I cannot open an Excel spreadsheet attached to an e-mail. If I close Excel and retry it will open Excel and the spreadsheet. Any ideas? I hate having to close all my open spreadsheets when I want to open a spreadsheet that's been e-mailed to me! One of these usually works with a similar problem starting workbooks by double clicking them in Windows Explorer. Maybe one will work for you and your email problem. Tools|Options|General|Ignore other applications (uncheck it) --- or --- Close E...

Can't create Organizational Forms Library in Exchange 2003 with SP
Hello, I cannot create an Organizational Form in EFORMS REGISTRY folder (from First Administrative Group->Folders->Public Folders->EFORMS REGISTRY in ESM). When I right-click the EFORMS REGISTRY folder and select New, there is no Organization Form. Instead, I only see Public Folder in the popup menu. Do you have any idea why Organizational Form menu does not show? My Exchange Server is Exchange 2003 with SP2. The login user is Administrator. Could you please help me? Thank you very much. Yang Is that account member of "Enterprise Admins" group? Yang Zhang wrote: &...

Outlook 2000 not opening.
I am having a major problem with outlook. Can anyone tell why Outlook will not open when selecting it. When I check in the processes there is an instance of Outlook.exe there but it is not doing anything. When a different user logs onto the machine Outlook will open fine with no problems. I have deleted the users profile and recreated it but to no use. I have tried comparing the local registry keys of the two users and they seem to be the same. Can anyone please help me as I have ran out of things to try. Thanks in advance. Justin Does Outlook start in /safe mode? (I'm assumi...

Pass parameter from FORM to QUERY
I have an append query that I trying to call from a cmd btn...but it prompts me for the parameter(ie QuoteID)... How do I tye it into my call: Dim stQueName As String stQueName = "Quote Query" DoCmd.OpenQuery stQueName, acNormal, acEdit On Apr 13, 12:56 pm, jlt...@hotmail.com wrote: > I have an append query that I trying to call from a cmd btn...but it > prompts me for the parameter(ie QuoteID)... > How do I tye it into my call: > > Dim stQueName As String > stQueName = "Quote Query" > DoCmd.OpenQuery stQueName, acNormal, acEd...

Office 2007 forms
I am creating a form with office 2007, will those people who do not use office 2007 be able to fill in my form? should I save it in a particular format? thanks Provided you start from the normal template, don't use fonts that were introduced with Word 2007, and save the form in Word 97-2003 document format, anyone with Word 97 or later should be able to open it. Use only the legacy form fields, to which end http://gregmaxey.mvps.org/Classic%20Form%20Controls.htm will make things easier. -- <>>< ><<> ><<> <>>< ><<...

How do I create a click on + symbol to open a root and click on -.
I'm looking to create an excel file with drop down menus. I'd like to have a category. Click on the "+" symbol and the category opens up and shows all of the subcategories. Each category can further be opened if I so choose. Each category can be have a number total associated with it. When you click the "-" symbol. The subcategories close and the sum total of all subcategories is shown in the category total. example. creating a budget. Category is utilities sub categories are: phone, cable, electric, gas, etc... Monthly utility total ...

How do I copy the result of a check box into another check box?
I'm trying to copy the result of a "check box form field" into another check box. For example: if I check (or uncheck) one box in a form, another box later in the protected form will also be checked (or unchecked) , much like the ref + F9 command for the text form field. Is this possible? Thanks. This cannot be done without macros. If your project will allow macros - see http://word.mvps.org/faqs/tblsfldsfms/ExclusiveFmFldChbxs.htm -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> G...

can I snap wrap points to a text box
rather than having to add individual wrap points to the edge of a frame, which is never as accurate anyway, can they be set to 'snap' to a frame (eg the ellipse) so that they are perfectly inline, (and which would of course be a lot quicker)? Edit points will not snap. There are options for edit points, select a point, right click. If you hold down control, the cursor will turn into an x, you can delete a point with a click. Truly a good draw program would be preferable. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com &q...

making filtering rules?
hi, i am trying to create a rule that goes something like if (site1.com OR site2.org OR site3.gov) AND (agri OR agriculture OR agribusiness) then move to folder X that is, if it is from any of those sites AND has any of those keywords then move it. The problem is i can't seem to figure out the specifying the AND part. Any help/ideas would be greatly appreciated! Cheers -Gaiko ...

How to track ActiveControl.Name when switching records in form with multiple subforms
I need to have a global variable always contain the name of the current form field. This bit of code is attached to the GotFocus event of all fields and the Enter event of all subforms: gxCurrentField = Me.ActiveControl.Name However it doesn't work properly when changing records in a subform. My parent form contains two subforms in a many-to-many relationship. The above variable usually ends up containing the name of the first field in the second subform when switching records in the first subform. How to correctly code this? Or is there some native variable I'm not aware of? I...

WLM Beta Junk Mail Filter
The junk mail filters has stopped filtering mail. The address shows in the list of blocked addresses but the mail is not filtered. The filter worked fine in WLM but I don't think it has worked since I loaded the Beta. Where exactly are you looking when you say the address is the same as the one in your Blocked Senders? The From line may not show the true entry, look at the entry in the From field you see after pressing Ctrl+F3 on that message. Gary VanderMolen, Microsoft MVP (Mail) "DickW2" wrote in message news:O7$LTHNMLHA.4084@TK2MSFTNGP05.phx.gbl... T...

how create Quota filter in WIndows 2003 R2 using Script
Hi all I need create quota filter in Server 2003 R2 using vbscript. quota filter should be applied to directories and not by users. I searched information about it on google without success. thank's in advance Daniel Hi Daniel. First you need open your FSRM (File Server Resource Manager), then you create a quota template, you must specify if your quota is "software" (just monitoring, but never deny the user) or "hardaware" (deny users when they use 100% of the quota), you must specify if you want send e-mail to user when this user use...

cursor missing from form textboxes
I believe that I know 98% of the little intricacies of Publisher, but I'm stumped on this one. I created a website with a contact page and none of the standard textboxes will show a cursor to indicate with field you are in (I've even made the site live to double check). If you tab between textboxes, the tabbing works, as does typing, there is just no visual cursor to indicate where you are. If you click on the first textbox and type, all is good you can tab to the next box and type, and it's fine. I'd like to have the visual cursor show and can't get it. I also have ...

Opening Multiple Web Links in a Column
Hi, I am very new to using web links in excel. A task I do very often is open a list of different websites that are in various columns in an excel spreadsheet. I am quite sure I am doing it the slowest way possible, so I need some help please. Basically I have been clicking on one link at a time. When I do this, the first website opens and excel automatically minimizes, then I have to go re maximize excel and then click the next web link and the same thing happens, etc... very time consuming. I am wondering if there is a way, either through Excel or whatever means necessary, to open all...

VBA form
Im using a form/macro that i linked to through another thread and a tailoring it to my needs. I basically have it doing what i need but cant get a button to do what i want. When the user starts the macro i brings up the form with a message and 2 buttons (Continue/Cancel). Whe continue is pressed i want the message on the form to change to aniothe message and so on until all messages are shown. Ive attacehed what i working on and apprecaite any help offered. Thank yo +------------------------------------------------------------------- |Filename: Excel.zip ...

Refreshing list boxes
Hi, I have created a database so that mulpile users can add detailss to the table - tblDetails from the form frmDetails or amend details in form frmAmend. I have a list box on the main page frmMain which has a list box lstSearch which shows all the records in the database. When users add new record to the database other users cannot see the added records unless the move to another section in the datbase and the return to the main page thus refreshing the list box. Can anyone tell me if there is a way I can put a "Refresh" button on the main page that updated the list box if the use...

when opening an excel file, 2 files open (one is book1)?
When I click on an excel file, 2 excel documents open up. One document is called Book1 and the other document is the actual document that I want to open. How do I stop this from happening? Brian To prevent Book1 from opening you can append /e to your shortcut for opening Excel. "C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\EXCEL.EXE" /e Alternative to the above............ Go to Start>Settings>Folder>Options>File Types. Scroll down to MS Excel Worksheet. Then if running Win98 OS Edit> select "Open" and Edit. If using WinXP OS you would scroll down to...

Cannot Drag Open Desktop Screen
Hi: I have a friend running XP MCE (2005) SP3 and he cannot drag an open screen on his desktop by Left clicking and holding cursor on the top of screen. Any suggestions as to how to remedy this problem of not being able to drag a screen will be appreciated Thanks, ColTom2. On Sun, 14 Mar 2010 16:48:43 -0400, "ColTom2" <noemailaddress@nomail.com> wrote: >Hi: > > I have a friend running XP MCE (2005) SP3 and he cannot drag an open >screen on his desktop by Left clicking and holding cursor on the top of >screen. > > A...

EMAIL FILTERS
For just over a week now ALL emails sent to me from external sources are going directly to my deleted files yet anything sent through my company network goes to my inbox as designed. I have looked into my rules and find nothing there to direct these emails to be deleted. Any suggestions where else to look? Disable all your rules. Enable them one at a time to find the culprit. It has to be a rule. CASEY wrote: > For just over a week now ALL emails sent to me from > external sources are going directly to my deleted files > yet anything sent through my company network goes to my...

Opening Excel email attachments
When downloading excel files AOL says cannot find suitable program.I then go online to find Excel but only get Uopdates. PC is XP version with Works Suite 2002. A fe months back my dear wife was downloading Excel an got board with waiting and shut down the PC! Any suggestions. Thanks Karl Hi there's no legal way to download Excel!! You have to buy< an Excel version and install it on your PC (or try to open the file with MS Works - but live with the restricted functionality) >-----Original Message----- >When downloading excel files AOL says cannot find >suitable progra...

calendar sometimes opens in month view
every once in a while (sorry that i can't be more precise), i find that clicking on calendar, under 'all folders' , causes it to open in month view. i can go back to inbox, and again click on calendar and get month view again. for most of a day. then it goes back to opening on current day. which it does most of the time. i don't remember if this happens after a reboot, standby, or just for no apparent reason. actually i prefer month view and wish i could make it open this way all the time. any ideas about what it happening here? ...

Scroll Wheel effecting a form
Is there any way to keep a mouse scroll wheel from having an effect on a form? This is a single form for data entry and if are part way thru the form and for what ever reasom use the scroll wheel all the fields on the form are effected (they dissapear - like going to the next new record). My suggestion to get a mouse without a scrool wheel was not met with enthusiasm. :) Any help here will be appreciated. Thanks in advance The scroll wheel is moving you through the records. Nothing except your view of the records is disappearing. The records are still there. I wouldn't think y...

problem opening up program/file
Hello, All. I am having some trouble opening up Word. It was working okay until I loaded some fonts to FontBook. Okay, now I removed all my fonts but I still get this error message about corrupt fonts I have on my computer. When I open Word, I see the blue starting-up window: Word:Mac 2004. Right underneath the product ID #, I see that it is initiating... when it gets to the point "Optimizing font menu performance" I start getting this error windows popping up one after another. (E.g. The font M TimesSmallText is corrupt and should be removed.) I keep on clicking okay for a whole lot...