Please help a newbie to access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've previously worked with lotus approach but I'm having difficulty with a
very basic database function and despite hours of pondering books I just hit
brick walls.
When I run a report the report shows the data from the table at time of
creation. When I run a filter in the table to show particular records in the
table view things seem fine, but when I open up the report the data has not
updated. I have found a way to achieve this by going into the design view and
applying another filter, but I can't help feeling that there must be an
easier way to show different sets of data in the same report. It was so easy
to do in approach. Please please help me if you can as this problem is giving
me many sleepless nights.
 
There's an example in the Northwind sample database. Look at the form "Sales
by Year Dialog", the report "Sales by Year", and the report's recordsource,
a query also called "Sales by Year".

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Mazzaxe,

Instead of making the report's recordsource the table itself, make a query
on the table and use that as the recordsource for the report. Having done
this, you can use a form with unbound controls to serve as criteria for the
query. This way, whatever is in the form when you open the report will
affect the data filtering.
To give you an example of how it's done: suppose a field you want to filter
on is LastName; form frmReportCriteria has an unbound textbox named
txtLName. The criterion in your query on the last name field could be:

Forms![frmReportCriteria]![txtLName]
or
Like Forms![frmReportCriteria]![txtLName] & "*"
or
Like "*" & Forms![frmReportCriteria]![txtLName] & "*"

etc, dependng on what you want to do; the first one will return only exact
matches, so entering John will only return Elton John (unless you know
someone else by that surname); the second one willreturn all surnames
starting John, e.g. John, Johnson, Johnston etc. The last one will return
surnames having John anywhere in them, so John, Johnson, Upjohn etc. will
all be returned.

HTH,
Nikos
 
Back
Top