Thanks for the ideas, I have been able to get the history bit working ok, but now I Have a further problem. The report I want to print is on a form and I select it from a drop list of available reports. I then want to open the report from the form, the trouble is the recordsource of the form is a query on the table I mentioned below. How can I include the name of the report in the query so it only selcts the one record?? Many thanks to anyone who can hel
----- Nikos Yannacopoulos wrote: ----
Naso
You don't necessarily need two tables, you can use the same one to defaul
the last settings in the form, by using DLookups on the same table wher
user = current user and report = selected report (I suppose the befor
update event of report selection is a good one to fire some code to populat
the parameter controls doing the lookups)... the only other thing require
being an autonumber field in the table (if not already there), so it'
easier for the DLookups to pick up the most recent record for each user
report combination. The code would be something like the following, in broa
lines
recnum = DMax("[AutonumberField]","TableName","[User]='" & CurrentUser & "
And [ReportName]='" & Me.SelectedReport & "'"
'(all above is one line, if it gets wrapped
Me.Detail1 = DLookup("[Detail1]","TableName","[AutoNumberField]=" & recnum
Me.Detail2 = DLookup("[Detail2]","TableName","[AutoNumberField]=" & recnum
...
Alternatively, you could get the record number in the same way, and use
recordset instead of the DLookups
HTH
Niko
Nasos said:
Niko, Thanks for your help
My problem is that I dont only want to append a new record to the lo
file, but also to keep the current selections to show as the default nex
time. I guess my problem is more complicated than I first said. I have tw
table," current " and "history", current table contains one record for eac
report in my application, history contains all the reports which have bee
printed and the details they included date printed, title used etc. The use
chooses a report on a form which shows hime the current data for th
specific report, he makes any changes necessary (usually just the date, an
then the report is printed and the history file is updated. The structure o
the two table is identical. (All the fields are identical.) If the repor
has already been printed on the same day I have a field called "copy" whic
increments so I know how many times it was printed. I can't use now for th
date printed because I want the user to specify the date he wants