- Your Tables & Forms go Right to Left. I've never seen that in Access!
There's no data in your Database that you attached.
I would:
Table1:
PersonID: Integer [Not AutoNumber like you have].
Fname: Text, 25.
LName: Text, 25.
Table2:
PersonID: Integer [Same as PersonID in Table1].
VisitDate: Date.
Description: Text, 255 [or shorter].
If a PersonID can have more than one Visit - then make your subForm into a Datasheet so that all Visits will show up for each PersonID.
You can try making your Main Form a Search Form based on values in Table 1 with ComboBoxes for cmbPersonID, cmbFName & cmbLName.
When a person selects a PersonID from the PersonID ComboBox and clicks a 'Search' Button [for example], you can open the Sub Form with code like this in the Click event for the Search Button:
Code:
DoCmd.OpenForm "SubForm", , , "PersonID = " & Me.cmbPersonID
When a person selects a FName from the FName ComboBox and clicks the 'Search' Button, you can open the Sub Form with code like this in the Click event for the Search Button:
Code:
DoCmd.OpenForm "SecondFormName", , , "FieldName = '" & Me.cmbFName & "'"
OR:
You can link your Main Form to your Sub Form using PersonID as the Link field. Make the Sub Form a Child Form of Main Form.
Then, when you select a PerosnID from your Main Form, the Sub Form will show all visits for that PersonID on the Sub Form.
Here's a link to a page that will help you with this project of yours:
http://office.microsoft.com/en-us/ac...010098674.aspx
I hope this helps!