Solved

User input for dates on Access forms and reports

Posted on 2013-06-07
3
361 Views
Last Modified: 2013-06-07
Hi Experts,

I am creating a 2010 Access db that will have forms/reports for printing labels that have the same date on each label and reports that will require  a different date at the head of every column.  What is the best method for getting the date(s) from users?  And how would I calculate the series of dates (for seven consecutive days) on the columns in the reports?

Thank you!
0
Comment
Question by:Skip Sleeper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 39230130
Create a little user prompt form with unbound fields for any user input information that opens first.  When completed, use a Continue button on the form to minimize it or make it invisible and run your report.  You can pass the values from your minimized from to your report.  Use the close event of your report to close the minimized form.

ET
0
 
LVL 20

Accepted Solution

by:
clarkscott earned 500 total points
ID: 39230159
I think you will need 2 input dates; one for the constant data (same date on every label) and a "begin" date (with 6 more calculated consecutive dates).

I would create a form with 2 text boxes labelled as "fixed date" and "begin date" (or whatever works for you).

Create 2 public variables:
public glbConstantDate as date
Public glbBeginDate as date

Create 2 functions to retrieve these values:

function get_glbConstantDate() as date
get_glbConstantDate = glbConstantdate
end function

function get_glbBeginDate() as date
get_glbBeginDate = glbBeginDate
end function

Now, on the afterupdate event of the "Fixed Date" textbox:

glbConstantDate = 0
if not isnull(me.YourFixedDateBoxName) then glbConstantDate = me.YourFixedDateBoxName

In the afterupdate of the "Begin Date" textbox:

glbBeginDate = 0
If not isnull(me.YourBeginDateBoxName) then glbBeginDate = me.YourBeginDateBoxName

Anywhere you want to use the Constant date - simply use this as it's source:
=get_glbConstantDate()

In the columns:
=get_glbBeginDate()
=dateadd("d",1,get_glbBeginDate())
=dateadd("d",2,get_glbBeginDate())
 
and so on.

Scott C
0
 

Author Closing Comment

by:Skip Sleeper
ID: 39230195
Thank you Scott, just what I was looking for!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question