473,895 Members | 3,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inputbox in Access Report to open only once

2 New Member
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 1405
NeoPa
32,584 Recognized Expert Moderator MVP
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
rmarsh57
2 New Member
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, 393 views)
File Type: jpg parameter.JPG (13.6 KB, 307 views)
File Type: jpg recoverable draw.JPG (14.2 KB, 278 views)
File Type: jpg enter previous.JPG (13.9 KB, 291 views)
File Type: jpg result.jpg (32.4 KB, 382 views)
Sep 2 '16 #3
PhilOfWalton
1,430 Recognized Expert Top Contributor
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 Recognized Expert Expert
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,584 Recognized Expert Moderator MVP
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
12780
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
23886
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 to use a database table but all I want to do now is to click a command button to display this access report. Any suggestions please ?????
2
15435
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
3719
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, , ".=" & _ intCurrentInvoice objAccess.DoCmd.Maximize
6
4334
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 can print it and all... here's my code Private Sub Command4_Click() Dim accObj As Access.Application
6
5235
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. Again, I have this part working. But the fields in the resulting spreadsheet are in a different order than the Access report. (Example: The fields in the Access report might go FirstName, LastName,Address,City--in the Excel spreadsheet, they come up...
17
21229
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 code, but getting an error.Can't I use recordset as record source for the report. Dim sDate As String Dim eDate As String Dim rsbatf As New ADODB.Recordset sDate = InputBox("Enter Beginning Period", "Beginning Period") eDate = InputBox("Enter...
1
2497
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 have a live MS Access report which would pull data from SQL Server. Iíll try to explain how Iím trying do this: The Access report should have two parts: 1. Title page report, just like table of contents. It should be listing a particular field of a...
1
1778
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 report in Access and then I can send it to Word. I also was able to save the file as a .rft or .txt file and then go to Word and open it. Is there a way to click the command button and have the report open in Word instead of Access? As always,...
0
1293
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. If I open a report only once through the application, then the report looks ok. When I try to open the same report again the fields in the page header section of the report are missing, but all other details are visible. Any ideas why I get this...
0
9988
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11247
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10841
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10931
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7175
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5860
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6066
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4684
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.