Re: Auto-generate recently visited record-list



Thank you for your help.

I sussesfully planted the record search combo box as discribed in your
link.
I got problems with you query solution, mainly because of lack of
knowledge.

I have two forms: contacts and companies
On the company form I added a combo list CompanyName ORDER BY Inserting
Date DESC. Inserting Date is one of the autofilled field autofilled
after I start to insert a new company.

From this combo box I tried to appoach my idea to get the most recent
companies on top of the list, however not all companies recently added
("inserting date") are approached again after that.

But, on each form we also have a Notes-field where we add the
progression. Below this field there is a button on that form inserting
the present date on the note:

Private Sub InDate_Click()
If Len(Me.Notes & "") > 0 Then
Me.Notes = Me.Notes & vbCrLf & Format(Date, "dd-mm-yyyy") & "
------ "
End If
If Len(Me.Notes & "") = 0 Then
Me.Notes = Me.Notes & Format(Date, "dd-mm-yyyy") & " ------ "
End If
Notes.SetFocus
Notes.SelStart = Len(Notes.Value)
End Sub


Sample of Notes contents:
01-05-2006 ------ Send email with brochure
03-05-2006 ------ Management meeting planned

I made a history table as you wrote to me with LogID and FKID.
Now I would like to perform the following:

How to have added the CompanyID after I click on the InDate button.
Because inserting a date in the Notes field (to add new info) means
this record is recently updated and I want to have this added to the
history list.

I have tried with AddNew, RecordSet but it was complicated.

With the added combo box I then can then create a list of companies
from the history table who are recently approached.

Bart.

Allen Browne wrote:
Use the Current event of the form to add a record to a history table that
logs the records visited. You can then use this table joined to your real
table to limit and sort the RowSource of your combo.

The history table would need these fields:
LogID AutoNumber primary key
FKID Number records the primary key value of the visited
record.

In the Current event of your form, append a record. Either Execute an Append
query statement, or AddNew. It you want to limit it to the top 5, you will
also need to Execute a Delete query to remove the others. Then Requery the
combo so the newly added record shows up.

Use the AfterUpate event of the combo to move to the desired record, using
code like this:
http://allenbrowne.com/ser-03.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"AA Arens" <bartvandongen@xxxxxxxxx> wrote in message
news:1149728859.612858.25110@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I have a database with 2 main forms. Contacts and companies. I share
the base with two others via LAN. On the companies form I have buttons
to navigate throught the records
(>400). We are mostly handling let say 5 companies. Every time I have
to navigate or choose the find record button to get the right company.

I am looking fo a feature to have listed in a combo list the last 5
visited records ("recently visited records").

I realize that the records visited by the two other persons are also
listed and..., when I revisit a record, there might be two same records
in the list.

Anybody knows how to make that feature?

Bart

.