Lin, Create a second table (if you havent already) with the following fields:
[red]1.[/red] ID (autonumber) ' just a unique identifier for record.
[red]2.[/red] MemberID (number) ' this field will contain the unique ID from the members table[red]
3.[/red] EDate (date) 'will hold the date of the visit.
[red]4.[/red] Notes (String) ' Seems like a good idea. You be the judge of this.
The idea is to add a new record to this table when a member visits. So
using a button on the form to execute the code, add something like the following:
Private Sub Button1_Click()
DoCmd.SetWarnings False
DoCmd.runSQL [red]"Insert Into [tblMemberVisits] (MemberID,Edate, Notes) Values (" & Me![ID] & ","& Now() & ",""" & Me![txtComments] &"""
" [/red]
DoCmd.SetWarnings True
End Sub
Drop code (like this) on your form; when the user clicks 'Button1', a new record will be added to the
Member Visits for the visitor record that is displayed on the form.
Note : This assumes that you have a Unique Key (called 'ID' here)for the
Member table, if you don't create it first.
With code like this in place you may want to refresh the display to show the new record. If you choose to display the Visits (history) table in a list box (created with the wizard for instance) along with the Members record. You will need to refresh the list box after adding a record.
Finally. You can extract records for visitors with something like :
"Select * from Members, tblMemberVisits Where Members.ID = tblMemberVisits.MemberID and Members.ID = [Enter Member ID]"
There's a lot of stuff to digest here. Use it to get what you're after. Any further questions? Let us know.
[sig]<p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br> [/sig]