current record

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi,
When I run my report I am presented, as expected, with a history of an item.
How can I print the current record shown instead of all records?

Regards

John
 
John

We're not there. We have no idea 'how' you might be running your report,
nor the table (or query on which it is based), nor your data structure, ...

I'm not sure what you mean by "history of an item" (see above).

How are you determining "current record"? Does this mean you are working in
a form and wish to only see the report for the record visible in the form?
(If you are working directly in a table or query, this won't work ... you'll
need to be in a form to get a report to run on the "current record").
 
Sorry Jeff,

I am trying to sort this in a query as well.

My report is sourced from a query called qryPolicePurchasesFromCustomers
the report is based on cars and there owner(s), hence the history.
When i run the report I get multiple reports based on the car registration
number.
However I only want to print the most current one. This is to be filtered
on the most recent transaction number generated from a form AutoID field and
the field is called [TNum]

Regards

John
 
If you use a little VBA, it is quite simple to open a form to the _selected
record_ in a currently open Form. You simply use whatever field uniquely
identifies the record, and use the value to construct a WhereCondition
argument for the DoCmd.OpenForm. The wizard creates a variable of a
different name, stCriteria. Check Help for the OpenForm method of DoCmd for
assistance with the WhereCondition.

If you'd prefer, you can go to more work to set up the WhereCondition for
the most recent that applies to some particular id... using multiple
conditions/criteria.

Larry Linson
Microsoft Access

John said:
Sorry Jeff,

I am trying to sort this in a query as well.

My report is sourced from a query called qryPolicePurchasesFromCustomers
the report is based on cars and there owner(s), hence the history.
When i run the report I get multiple reports based on the car registration
number.
However I only want to print the most current one. This is to be filtered
on the most recent transaction number generated from a form AutoID field
and the field is called [TNum]

Regards

John



Jeff Boyce said:
John

We're not there. We have no idea 'how' you might be running your report,
nor the table (or query on which it is based), nor your data structure,
...

I'm not sure what you mean by "history of an item" (see above).

How are you determining "current record"? Does this mean you are working
in
a form and wish to only see the report for the record visible in the
form?
(If you are working directly in a table or query, this won't work ...
you'll
need to be in a form to get a report to run on the "current record").

--
More info, please ...

Jeff Boyce
<Office/Access MVP>
 
Larry
The record isnt shown on a form, its on a report.
there are many records on the report but I only want to view the most
current.
The unique fields are [TID] and [TDATE].

Help please

John


Larry Linson said:
If you use a little VBA, it is quite simple to open a form to the
_selected record_ in a currently open Form. You simply use whatever field
uniquely identifies the record, and use the value to construct a
WhereCondition argument for the DoCmd.OpenForm. The wizard creates a
variable of a different name, stCriteria. Check Help for the OpenForm
method of DoCmd for assistance with the WhereCondition.

If you'd prefer, you can go to more work to set up the WhereCondition for
the most recent that applies to some particular id... using multiple
conditions/criteria.

Larry Linson
Microsoft Access

John said:
Sorry Jeff,

I am trying to sort this in a query as well.

My report is sourced from a query called qryPolicePurchasesFromCustomers
the report is based on cars and there owner(s), hence the history.
When i run the report I get multiple reports based on the car
registration number.
However I only want to print the most current one. This is to be
filtered on the most recent transaction number generated from a form
AutoID field and the field is called [TNum]

Regards

John



Jeff Boyce said:
John

We're not there. We have no idea 'how' you might be running your
report,
nor the table (or query on which it is based), nor your data structure,
...

I'm not sure what you mean by "history of an item" (see above).

How are you determining "current record"? Does this mean you are
working in
a form and wish to only see the report for the record visible in the
form?
(If you are working directly in a table or query, this won't work ...
you'll
need to be in a form to get a report to run on the "current record").

--
More info, please ...

Jeff Boyce
<Office/Access MVP>

Hi,
When I run my report I am presented, as expected, with a history of an
item.
How can I print the current record shown instead of all records?

Regards

John
 
John

Have you looked into using the Totals query (see the Greek sigma button on
the toolbar)? Without a look at the SQL code your query already uses, this
is only a guess.

If you used the Totals query, and used the Max([YourDateField]), would that
return 'the most recent'?

--
Regards

Jeff Boyce
<Office/Access MVP>

John said:
Sorry Jeff,

I am trying to sort this in a query as well.

My report is sourced from a query called qryPolicePurchasesFromCustomers
the report is based on cars and there owner(s), hence the history.
When i run the report I get multiple reports based on the car registration
number.
However I only want to print the most current one. This is to be filtered
on the most recent transaction number generated from a form AutoID field and
the field is called [TNum]

Regards

John



Jeff Boyce said:
John

We're not there. We have no idea 'how' you might be running your report,
nor the table (or query on which it is based), nor your data structure,
...

I'm not sure what you mean by "history of an item" (see above).

How are you determining "current record"? Does this mean you are working
in
a form and wish to only see the report for the record visible in the form?
(If you are working directly in a table or query, this won't work ...
you'll
need to be in a form to get a report to run on the "current record").

--
More info, please ...

Jeff Boyce
<Office/Access MVP>
 
Thanks all,

Eventualy got the desired result

Regards

John

Jeff Boyce said:
John

Have you looked into using the Totals query (see the Greek sigma button on
the toolbar)? Without a look at the SQL code your query already uses,
this
is only a guess.

If you used the Totals query, and used the Max([YourDateField]), would
that
return 'the most recent'?

--
Regards

Jeff Boyce
<Office/Access MVP>

John said:
Sorry Jeff,

I am trying to sort this in a query as well.

My report is sourced from a query called qryPolicePurchasesFromCustomers
the report is based on cars and there owner(s), hence the history.
When i run the report I get multiple reports based on the car
registration
number.
However I only want to print the most current one. This is to be
filtered
on the most recent transaction number generated from a form AutoID field and
the field is called [TNum]

Regards

John



message
John

We're not there. We have no idea 'how' you might be running your report,
nor the table (or query on which it is based), nor your data structure,
...

I'm not sure what you mean by "history of an item" (see above).

How are you determining "current record"? Does this mean you are working
in
a form and wish to only see the report for the record visible in the form?
(If you are working directly in a table or query, this won't work ...
you'll
need to be in a form to get a report to run on the "current record").

--
More info, please ...

Jeff Boyce
<Office/Access MVP>

Hi,
When I run my report I am presented, as expected, with a history of an
item.
How can I print the current record shown instead of all records?

Regards

John
 
Back
Top