Problem with parameters and a pop-up box

Hello all,

I have been asked to create a report based on a query with a
parameter. Basically the user clicks on a button on a form that runs a
query, the query asked them to enter a project number, their answer is
then brings up a report with only the requested project number.

The problem that I am having is that if the project number that is
entered doesn't exist it just opens up a blank report. What I would
like it to do is have a pop-up message box that say "No records". Does
anyone have any ideas on this one?

Thanks,

~Amanda~

0
AmandaH
10/2/2007 3:43:45 PM
access 16762 articles. 3 followers. Follow

3 Replies
642 Views

Similar Articles

[PageSpeed] 2

On Oct 2, 10:43 am, AmandaH <amandah...@hotmail.com> wrote:
> Hello all,
>
> I have been asked to create a report based on a query with a
> parameter. Basically the user clicks on a button on a form that runs a
> query, the query asked them to enter a project number, their answer is
> then brings up a report with only the requested project number.
>
> The problem that I am having is that if the project number that is
> entered doesn't exist it just opens up a blank report. What I would
> like it to do is have a pop-up message box that say "No records". Does
> anyone have any ideas on this one?
>
> Thanks,
>
> ~Amanda~

use the NoRecords property of the report to cancel the open event.

Private Sub Report_NoData(Cancel As Integer)
    MsgBox "No data to show..."
    Cancel = True
End Sub

0
pietlinden
10/2/2007 4:04:36 PM
Amanda

Consider a different approach.

What you've described requires the users to memorize project numbers.

Another approach would be to add a combo box (unbound) on your form.  The 
combo box lists projects (with Project Number plus more descriptive fields). 
By setting the width of the first field (ProjectNumber) to "0", it won't 
show on the form.

Now modify your query to look at the value in the combo box on that form 
(use the following instead of the parameter prompt the query has now):

    Forms!YourFormName!cboYourComboBoxName

Keep the button.  When you click it, the report starts to open, then runs 
the query, which looks (back) at the form to find the ProjectNumber in the 
combo box.

JOPO (just one person's opinion)

Regards

Jeff Boyce
Microsoft Office/Access MVP

"AmandaH" <amandah_17@hotmail.com> wrote in message 
news:1191339825.638017.150700@19g2000hsx.googlegroups.com...
> Hello all,
>
> I have been asked to create a report based on a query with a
> parameter. Basically the user clicks on a button on a form that runs a
> query, the query asked them to enter a project number, their answer is
> then brings up a report with only the requested project number.
>
> The problem that I am having is that if the project number that is
> entered doesn't exist it just opens up a blank report. What I would
> like it to do is have a pop-up message box that say "No records". Does
> anyone have any ideas on this one?
>
> Thanks,
>
> ~Amanda~
> 


0
Jeff
10/2/2007 4:40:14 PM
Thanks for both of your answers. The second option, using the combo
box, is a good one and I may use it on following projects. For this
one, however, the users will have the project number in front of them
as they will only be asked questions directly related to the project
number. Some of the numbers also look very similar at a quick glace so
this would also run the risk of pulling up the wrong information.

Thanks again for the input.

~Amanda~

0
AmandaH
10/2/2007 5:43:35 PM
Reply:

Similar Artilces:

Can I make a table flow like a text box story?
Does anyone know of a way to allow a table to act similar text block story. I would like to snake a long data table into two columns over several pages. Any ideas would be appreciated. Thanks, This is not at all possible. A Table will not move across pages. -- Thanks -- It would be a great feature -- but I couldn't find a way to do it either. BTW -- neither PM or Quark allow this either. >-----Original Message----- >This is not at all possible. > >A Table will not move across pages. > >-- > > >. > You can create a work around for this problem by...

Check box and Command button code #2
This code will change the named range of cells yellow when the check box is checked and the command button is pressed which is what I want it to do, but when you check the check box, it will take the user over to my second worksheet named form where the range of cells are. I would like for it to wait to take them over after they press the command button because multiple check boxes will need to be checked. Any help is greatly appreciated. Option Explicit Private Sub CommandButton1_Click() Call CheckBox2_Click End Sub Private Sub CheckBox2_Click() If Me.CheckBox2.Value = False Then ...

Problem with a Array formula, Please help !!
What is the problem with the array formula (see cells in column R, which are highlighted coloured yellow) ? {=IF(SUM(IF(ISERROR(LOOKUP(N(OFFSET($B2,,{0,2,4,6,8,10,12,14})),IF($A2="ABC",A!$A$2:$G$140,B!$A$2:$G$210))),0,IF(LOOKUP(N(OFFSET($B2,,{0,2,4,6,8,10,12,14})),IF($A2="ABC",A!$A$2:$G$140,B!$A$2:$G$210))="Y",1,0)),IF(ISERROR(LOOKUP(T(OFFSET($B2,,{0,2,4,6,8,10,12,14})),IF($A2="ABC",A!$A$2:$G$140,B!$A$2:$G$210))),0,IF(LOOKUP(T(OFFSET($B2,,{0,2,4,6,8,10,12,14})),IF($A2="ABC",A!$A$2:$G$140,B!$A$2:$G$210))="Y",1,0))) >0,"Y...

Problem cleaning up temporary files.
This isn't MFC specific so I apologize. I just like the information provided by the regular members of this group. I have an application that has a Rich Edit control. Next to the Rich Edit control is a Print button. To avoid all the details of printing, I decided to save the contents of the control to a RTF file, then do ShellExecuteEx("blahblah.rtf", "print", ...). This works fine. But, I sure would like to remove these temporary files. But I am finding that to be a tricky problem to solve. At first, I thought I would wait for the process started to end. Bu...

Workflow Problem
Hi all, some instances (approx 5%) of a workflow we use all the time are getting stuck at various points when we do a status reason change - the logs show the following error: Error Code = 80044151. SQL Server Error. SQL Server timeout expired. Our sql server is very under utilised and most of the workflows change states OK - any ideas ? Thanks Ian If the issue you're experiencing applies to Quotes/Orders/Invoices, the following Hotfix may help: https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?WTNTZSMNWUKNTMMYVLXUZLWUKKQPOVRVQNLNWOMXNQRQNZWVLNLTUPRNNUWPNZSZ "Ian K...

Cascading Parameters
I'm trying to set up a cascading parameter and can't seem to get it working. It's basically a State --> Cities types of relationship (in this case, it's actually "regions" or "districts" within a state, and the "counties" within that district, but same difference). I'm pulling the data from ref tables in an Oracle DB (10g) Basically, I want to choose the District with the 1st param, then have the 2nd param build its list of available values on what was chosen. I pull Districts just with a straight query on the database ta...

OpenArgs and unwanted Parameter Boxes
I am building a project using Access 2003 sp2 linked to a SQL 2000 Database. All tables and queries are SQL based. I have a search form that supplies between one and three parameters to a searchresults subform. The subform displays employee wage information, and the parameters supplied can be any combination of Insurance No, Date of Birth and Surname. The parameters are passed to the subform as a pipe delimited string via the OpenArgs property of the Openform method. Code in the subform disassembles the Openargs string using the Split function and generates up to 3 arguments. These argu...

OMA problem #5
Hi all We are currently trying to connect a couple of users Nokia 6230i to exchange just to check their mail. When they login through either pc to test or the mobile the get the following error message Your user account has not been enabled for wireless access. Please contact your system administrator for additional assistance We have checked in AD and the accout is enabled for oma. W2k3 server with exhcnage w2k3 sp2. Can anyone shed some light on this Cheers Glenn Hi, You've taken the primary domain SMTP suffix address of these users. For OMA to work succesfully, a user _must_ ...

Exchange Server/Relay Server Problem
I am in the process of moving all users from our old e-mail domain to the new e-mail domain. The old e-mail accounts reside on a Linux server running QMail with a domain similar to organization.com. All new accounts are being moved to an Exchange Server with the domain name of organization.ca; The Exchange server had been configured to relay all mail through the Linux server. As we moved people to the new domain name (organization.ca) the QMail server was configured to forward the users mail to the new accounts. It did so flawlessly until Friday... On Friday administration decided they...

drag and drop problem with cell references
i have a cell with a formula in one worksheet that references another cell. the formula looks like this: =IF((ISBLANK('Draft'!$D25)),"",'Draft'!$D25) where 'draft' is another worksheet in my workbook. the formula works fine, it looks empty if there is nothing in the referenced cell('Draft'!$D25), otherwise it mirrors the content of that cell. If i type something in the referenced cell('Draft'!$D25), it still works great. But if i drag something to the referenced cell than the formula gets screwed up and replaces the $D25, with #ref. I am gue...

Problems Backing up MS Money
I am running Microsoft money 2004 on a 64 bit windows vista machine. When I go to back up my files at the end of a session, money thinks that my 8 gig flash drive is a floppy disc and tells me that the disc is full and to insert another one. Does anyone have any ideas on how to remedy this. This is something new, it was working alright for months. Any ideas? M2004 only knew about hard disks and floppies for backup. There was a "feature" whereby it could only handle 2gb USB sticks. You need to reduce your available space on the USB to under 2gb, by copying any old files till t...

dialogue box
Can anyone offer help: When I click on the "new" tab in outlook a dialogue box comes up that says " A dialogue box is open. close it and try again". I don't have anything else open. Any ideas?? See http://www.msoutlook.info/question/118 -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- "Elliott" <Elliott@discussions.microsoft.com> wrote in message news:EBE71DB2-CC86-...

excel formula problem #3
i want to set up a system that counts a series of dates but only say how many cells are filled, i can get this to work generally but section needs to count 3 seperate dates but only add on any one of the (eg) cell A counts the number of dates in cells B-Z but with cells D,E, i dont want all to count, only one of the three even if all are filled but it must count if any of the three are filled hope this makes sens -- Message posted from http://www.ExcelForum.com Hi try: =COUNT(B1:C1,G1:Z1)+(COUNT(D1:F1)>0) -- Regards Frank Kabel Frankfurt, Germany > i want to set up a system that c...

Problem with 'AutoCorrect file'
Glad if any could help out. Keep getting a dialogbox preventing work in Excel stating 'Your AutoCorrect file, C\User\....\AppData\Roaming\Microsoft\Office\MSO2057.acl could not be saved. The file may be read only, or you do not have permission to modify the file.' I am the only user on the HP Pavilion laptop with Vista Home Premium and running Office 2007 professional. What did do wrong and how to rectify? ...

Modal and Modeless dialog boxes
I have a modeless dialog box and also modal dialog box in some application. When both appear I would expect the modal box to eliminate any access apart from it but I can access the modeless as well and it could get focus just as the other box. Is that normal or am doing something wrong? Can I force the focus to be only on the modal box? Thanks Gil Gil wrote: > I have a modeless dialog box and also modal dialog box in some application. > When both appear I would expect the modal box to eliminate any access apart > from it but I can access the modeless as well and it could ge...

Updating Subform check box from Mainform check box
Hello, I've always found this site extremely helpful for figuring out my Access problems but this one has me stumped. Forgive me, since I do not know how to write code. I have a Mainform called Open PO Main Form that is linked to a subform called Open PO Sub Form by a field called CustomerPONumber. I would like my user to be able to check off the box called DELIVERED on the Main Form and have it automatically check off the box called SUBDELIVERED on the Subform. Any help that you could offer would be greatly appreciated! Lemonade Lemonade, You may want to try setting the control...

Which has the problem with delaying
Hi all, Exchange 2003 envir. We have one appliance to accept the email for our domain and relay to our exchange servers. But, one user received one message 7 days later. I called appliance vendor and tracked the message which received and delivered it to exchange server on 6/20/2010. But, the user receives it on 6/27/2010. From the header of the message, it shows appliance receives it on 6/20/2010 and received by exchange server on 6/27/2010. Which has a problem with it? Appliance or Excahnge server? Where does the message sit for 7 days? (we have two days time out...

stretch text box very very little
In publisher on a calendar I use text box in the date square. Some I can stretch a very very little others stretch too much. How do I make them all so I can stretch them very very little. That way I can get them very close to the date box line and not go pass it. heritageheath wrote: > In publisher on a calendar I use text box in the date square. Some I can > stretch a very very little others stretch too much. How do I make them all > so I can stretch them very very little. That way I can get them very close > to the date box line and not go pass it. I'm entirely ...

restoring exchange 2000 SBS stores to a differnt exchange box...
We are looking at dumping our SBS 2000 box and would like to set up a different win2K box with just the std version of exchange 2000 until such time as we can afford to upgrade to the newest version of exchange. I need to get this up and running asap.Can I setup my new win2k server, running the regular version of exchange 2000 and then once setup restore my sbs exchange 2000 information stores to this new box running the regular version of exchange 2000?? Are the information stores in the sbs 2000 version of exchange the same as the std version of exchange 2000 or will I run ...

parameter valves are not valid, error when closing out of outlook?
When I exit-out of Outlook 2003 after being in notes, I get this error message: Could not complete the operation. One or more parameter valves are not valid. The next error tells me: note will close and your changes will not be saved. I have tried to reinstall office and the repair function for outlook but I still get the error!! Can anyone help me? -- wfwh3rd ...

problem with scaning
hello happy new year I want to scanning multipage documets and save it in my folder. I tryed to scaning without any component . I want to use with microsoft windows acquire library(wia) and save it tiff format. please help me how can create a form with a command button and writting its vba code that it stats scanning and saving file(tiff format) in my folder . thank you hesm ...

File Attachment Problem
I have got the file attachment problem since we implemented the dynamics CRM 4.0. So i will be glad if you advise me a way to solve this problem. sincerally ...

Graph OLE Linked objects problem
I got error message from access2003 when I tried to open a Graph OLE Linked objects, the message is: Strategic Budget builder can't find the file containing the linked OLE object you tried to update using OLE/DDE links command. When I click "yes", the other message pop up: "You may have misspelled the file name, or the file may have been deleted or renamed. If the file has been moved to a different location, use the OLE/DDE Links command to change the source. Or delete the object, and create a new linked object." Tried to re-installed OFFICE2003, but it still do...

ADP in A2007 Runtime: Traditional binding of form to stored procedure taking no parameters no longer works
Forms in ADP can have a stored procedure as the RecordSource. Traditionally we could write: RecordSource="dbo.EmployeesList" (or use the RecordSourceQualifier to specify "dbo"). On A2007 runtime this no longer works: The record source 'EmployeeList' specified on this form or report does not exist. On A2007 (with or without the /runtime command line switch) it does work. The only workaround I have found so far is to put the entire expression in the RecordSource property like this: "exec dbo.EmployeesList". I don't think this is an intentional change b...

Date Format Problems
Is there anyway to make excel change the numbers I type in to the appropriate date? If I type 112603, how can I get the cell to display 11/26/03. I have tried formatting the cell, but it just doesn't seem to come out right. Any help would be greatly appreciated. Thank you Jennifer Only through VBA. See Chip Pearson's website. http://www.cpearson.com/excel/DateTimeEntry.htm Gord Dibben XL2002 On Fri, 5 Dec 2003 08:06:01 -0800, "Jennifer W" <icecream3@earthlink.net> wrote: >Is there anyway to make excel change the numbers I type in to the appropriate date?...