471,893 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,893 software developers and data experts.

Inputbox in Access Report to open only once

I generate a report using a parameter to filter records. Sometimes there's one record, sometimes many more.
I have inputboxes display so the user can enter data specific to that filter, not to each record. The user only needs to enter data once per filter.
However, the inputbox displays once per record in the filter.
How would I limit the inputbox to open once and only once per filter?
Thanks in advance for your help.
Sep 1 '16 #1
5 1223
32,470 Expert Mod 16PB
Normally it would anyway, but there are ways to complicate it, of course.

You haven't shown us what you're trying.
Sep 2 '16 #2
Hope this helps explain. (First time using BYTE)
I've attached 5 snips.

The inputbox functions.jpg shows the 2 input functions I used. The problem is I only want them to open once when I run the report, regardless of how many records that particular salesperson has.

The parameter.jpg is where I filter to only one salesperson.

The recoverable draw.jpg and enter previous.jpg are the inputboxes I want to open only once. These reflect a number charged once a month, not on each sale.

The result.jpg is the outcome we expect, however, if the salesperson has 10 records, the input boxes open 10 times each, and since there are 2 inputboxes we have to click OK or cancel 20 times.

Attached Images
File Type: jpg inputbox functions.jpg (78.7 KB, 345 views)
File Type: jpg parameter.JPG (13.6 KB, 268 views)
File Type: jpg recoverable draw.JPG (14.2 KB, 242 views)
File Type: jpg enter previous.JPG (13.9 KB, 252 views)
File Type: jpg result.jpg (32.4 KB, 345 views)
Sep 2 '16 #3
1,430 Expert 1GB
you might like to have a look at https://bytes.com/topic/access/answe...filter-reports
Here a form opens to input all the parameters in one go and generates the report.

Although in this example shows 2 combo ranges and 2 text ranges, I was too lazy to program the second combo & text box as they weren't needed

Sep 2 '16 #4
8,827 Expert 8TB
InputBoxes are not the path to take but if you insist on this approach and wish to be prompted for Parameters only once, then you can use the WhereCondition Argument of the OpenReport() Method. As an example, I am prompting for State and Zip Code Values prior to Opening a Report on Employees in the Northwind Sample Database. These 2 prompts will only appear once:
Expand|Select|Wrap|Line Numbers
  1. Dim strState As String
  2. Dim strZip As String
  4. strState = InputBox$("Enter State")
  5. strZip = InputBox$("Enter 5-digit Zip Code")
  7. If strState <> "" And strZip <> "" And IsNumeric(strZip) Then
  8.   DoCmd.OpenReport "rptEmployees", acViewPreview, , "[State/Province]='" & strState & _
  9.                                "' AND [Zip/Postal Code] = '" & strZip & "'", acWindowNormal
  10. End If
Sep 2 '16 #5
32,470 Expert Mod 16PB
Your answer was very full, but what I was looking for was how these items were used in the code.

You can see from some of the other answers that simply popping up an inputBox is often not the smoothest, or even easiest, way to approach this. Why the InputBoxes recur though, will be found in the code you invoke them with.

Certainly though, Example Filtering on a Form has information that will help do it all in a more straightforward way.
Sep 5 '16 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by El_Embozador | last post: by
2 posts views Thread by Tom Weddell | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.