using macro change record

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » Using Macro to change Record Source in Reports | Access forum

Using Macro to change Record Source in Reports | Access forum

resolvedResolved · Low Priority · Version 2007

James has attended:
Access Intermediate course
Access Advanced course

Using Macro to change Record Source in Reports

This is a simple document / template retrieval system.

I have one report in one style which, when generated offers hyperlinks to the required document or template.

It can run many alternative queries (I'm interested in 123 permutaions)

I have a grid of command buttons on a single control panel.

Each button represents one query and the associated report.

How, with one click of the button, do I get the query to select the correct parameters, return the data for and become the link in the record source of the report that I want to view?

The idea is one click to see what is available, and one click to access the resource.

The simpler to understand the better please. I'm brand new at this.

RE: Using Macro to change Record Source in Reports

Hi James

Thanks for your post. We may well be able to find a solution but we will need to see your files to investigate further.

As this falls outside the scope of this forum what we would ask is for you to email your files to us we can then let you know if a solution can be found, trainer development time required and any related costs.

Please drop me an email if you are interested in looking at this further.

Kind regards

Jacob


 

Access tip:

Calculating The Difference Between Dates

If you wish to calculate the time between two date fields, this can be done in a number of ways:

1. As a calculated field in a query
2. As a calculated control in a form or report
3. As a calculation in a VBA procedure.

The basic syntax to get the number of days between two dates is:

=[One Date Field] - [Another Date Field]

You can also use one of the following functions:

=Month([One Date Field] - [Another Date Field])
which calculates the number of months between the two fields

=Year([One Date Field] - [Another Date Field])
which calculates the number of years between the two fields.

Another function is the DateDiff() function.

It uses an argument to determine how the time interval is measured. For example:

=DateDiff("q",[One Date Field] - [Another Date Field])
returns the number of quarters between the two fields.

Other intervals that can be used in this expression are as follows:
"yyyy" - Years
"m" - Months
"d" - Days
"w" - Weekdays
"ww" - Weeks
"h" - Hours
"n" - Minutes
"s" - Seconds

View all Access hints and tips


Server loaded in 0.08 secs.