473,378 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 1371
NeoPa
32,556 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, 384 views)
File Type: jpg parameter.JPG (13.6 KB, 297 views)
File Type: jpg recoverable draw.JPG (14.2 KB, 270 views)
File Type: jpg enter previous.JPG (13.9 KB, 282 views)
File Type: jpg result.jpg (32.4 KB, 374 views)
Sep 2 '16 #3
PhilOfWalton
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

Phil
Sep 2 '16 #4
ADezii
8,834 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
  3.  
  4. strState = InputBox$("Enter State")
  5. strZip = InputBox$("Enter 5-digit Zip Code")
  6.  
  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
  11.  
Sep 2 '16 #5
NeoPa
32,556 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

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

Similar topics

1
by: El_Embozador | last post by:
Hi , please can you tell how i can print an MS ACCESS Report form visual basic, i ned a sample code .. Thanks
3
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how...
2
by: Tom Weddell | last post by:
Can I call an Access report from VB.Net? (I'm using access as the backend.) Thanks in advance.
3
by: Newbie | last post by:
This is my first try at running Access Report by Visual Basic I have the following code in my button press event: ' 2 - Show print preview objAccess.DoCmd.OpenReport "Invoices", 2, , ".=" & _...
6
by: icony | last post by:
Hi everyone, Here's my problem. I have a report that i want to use with the command openreport. The report open and close in a fraction of a second. I cant see why i cant view the thing. Cause i...
6
by: DeniseY | last post by:
I have an Access report that is created on the fly by the user selecting the fields to be included. The Access report comes out fine, but I want it to automatically output to an Excel spreadsheet....
17
by: kkk1979 | last post by:
I have been using access as front end and SQL as Back end. I need help in generating an access report, by using a stored procedure with input parameters as record source. I tried the following...
1
by: sonicfun2006 | last post by:
I have SQL Server Database and MS Access 2003 is connected with ODBC. I have very large amount of records in various tables. The database is very dynamic as it changes every minute. I’m trying to...
1
by: dougmeece | last post by:
Good Morning Experts, I was trying to find a way to automatically open a report in MS Word when I click on a command button. I was not able to find a way to do that. I was able to open the...
0
by: flomaster | last post by:
Hi, I have created a c# application which uses Microsoft Access Reports. The application works ok on my laptop but when I installed it on other pcs ( more than 5 ) the following problem appears. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.