473,586 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Receipt Generator

smithj14
18 New Member
I am working on an access app that will generate receipts for clients who pay our company. I am stuck on two things.

First: I want to increment a receipt number automatically without using AutoNumber. I have a seperate table "RECEIPT_NUMBER " with a field "RCPT_NUM" to hold the receipt number value. I have my main form and table "RECEIPT" with a field "Receipt_Number " that needs to pull the last used receipt number and add 1 to it for the new receipt.

Second: I am trying to print a report based on a date range. I tried a few of the examples online but none worked.

If anyone could lend a brain I would be greatly appreciative.
Jul 30 '08 #1
4 5669
missinglinq
3,532 Recognized Expert Specialist
Here's a general example:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2. If Me.NewRecord Then
  3.  If RecordsetClone.RecordCount = 0 Then
  4.   Me.RCPT_NUM = 1
  5.  Else
  6.   Me.RCPT_NUM = DMax("[RCPT_NUM]", "RECEIPT_NUMBER") + 1
  7.   End If
  8. End If
  9. End Sub
This assumes that your receipt numbers are Numerical datatype. If they're actually Text post back and I'll show you the slightly different syntax. I've also placed this code in the Form_BeforeUpda te event. Because of this the number will only show up after the record is saved, but it's neccessary to place it here for a multi-user database, so that two users starting a record don't generate the same number. If this is a single user database, you can place the identical code in the Form_Current event and the number will show as soon as a new record is started.

Welcome to Bytes!

Linq ;0)>
Jul 30 '08 #2
NeoPa
32,566 Recognized Expert Moderator MVP
For the Date Range issue, check out Literal DateTimes and Their Delimiters (#).

This also depends on exactly what you're intending to achieve with this. Again, post back if you need more help.

PS. It's generally a good idea (and we prefer it so) that separate questions are posted in separate threads. It just makes it so much more straightforward to deal with them.
Aug 5 '08 #3
smithj14
18 New Member
Date Range issue:

I need to print a report that shows all the receipts created for a certain date range. It could be for one day, two days or for the whole month. I can get the prompts to ask for a date range if I use a query but would rather have two txtBoxes to enter the dates I need to filter by. When I try it now I am getting the report to open but no data displays.
Aug 11 '08 #4
NeoPa
32,566 Recognized Expert Moderator MVP
...When I try it now I am getting the report to open but no data displays.
WHAT are you trying?

How can we possibly help if you keep the question so secret?
Aug 11 '08 #5

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

Similar topics

3
1667
by: Neal D. Becker | last post by:
I am converting optimization code from legacy C to python. Generators are a HUGE convenience, because the original code structures have the optimizer as the main code calling your function, while I want to invert these roles. I want to call the optimizer to perform just one step at a time. So, the optimizer must preserve it's state. The...
4
11416
by: Rich Moser | last post by:
My organization is in the midst of making a reporting tool decision. On the table are Crystal and the reporting functionality in Access. - Report distribution is not a factor - it's all local - Training time is a factor since we have to create a boatload of reports in a short time - The ability for users to modify report formats and data...
4
3864
by: aaa | last post by:
Hi I am considering using LLBL O/R mapper/data-access tier generator. Until now I have been using CodeSmith "home made" templates for DAL classes and store procedures generation. I have also noticed that LLBL code does not use datasets, and as I have been using datasets for databinding operations I wonder how is it achieved if using LLBL.
22
2211
by: Deano | last post by:
Hi, I have a finished Microsoft Access app that we are distributing using an Access runtime. This works fine (mostly) but I'm sold on the advantages of dot.NET and upgrading to vb.NET seems like a good idea for the future. I'm also keen to develop new software in vb.NET as soon as possible. I will work out how to port the app and how to...
10
24368
by: Mike Charney | last post by:
Is there a simple way to send SMTP email from Access VBA? Mike m charney at dunlap hospital dot org
1
9506
by: hasanainf | last post by:
Hi all and thanking you all in advance for your help My client wants to use a receipt printer. Since I have never used one before I have some questions. 1. Unlike other printers which are set by default to print a whole A4 size page, I want the receipt printer to print an unlimited lenght of receipt, that is to say that if five items are...
1
4770
by: Mose | last post by:
Greetings! I am using Access '97 to track company orders. It's a pretty basic setup featuring a main table (tbl_SalesSlip) and a related table (tbl_ModelsSold). I would like to send an email that contains information from both tables, but am unsure how to go about it. The data is normalized. A sample of what I would like to send: Data...
4
6449
by: Ronald S. Cook | last post by:
Does anyone know the top few 3rd party products for data access layer generation? We're looking into DeKlarit but don't know if they're the most popular/common out there for VS2005 integration. Thanks, Ron
0
1331
by: sangam56 | last post by:
hi all. I am developing an ASP.NET web application. I have database and stored procedure in Oracle 8i. I am using Visual Studio 2005 and my language is C#. I want to generate the data access and data object layer for VS 2005. I used RapTier tool for generating stored procedures. I did not find it better for data access layer generation....
0
7912
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...
0
8202
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. ...
0
8338
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...
0
8216
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5390
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...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.