Unanswered: Open form from a subform to specific record
I am new to this program and need help to design a small database. I am making a dataset to track people’s visits to our office - so I have made 2 tables. The first is the demographic table with each person’s SSN being the primary key. The second table is a visit level data where SSN and Visit_date are the primary keys. When I open the database – I have it set up to open a form with a subform – the form is the demographic level data and the subform is the bare basics from the visit level data. I want to make it so that we can click on either a button beside each visit date or the visit_date field to open the visit form on that specific record. Does this make sense? I am having trouble with the visual basic code because I don’t know how to handle the demographic table not having the visit_date. I can get a command button to work to open the form but it goes to the first record in that table which doesn’t help me. Any suggestions would be great!
The first is the demographic table with each person’s SSN being the primary key.
I would STRONGLY discourage you from using a SSN as anything but a confidential record for HR only! There are so many legal risks involved there, it's best to ONLY use the SSN when you're absolutely sure (1) that you HAVE to use it, and (2) you can be sure to keep it secure.
But back to your question. When you open the form you can either simply filter only the record you want using the third argument of the OpenForm Method, or you can use the generic OpenArgs argument in conjunction with the FindRecord method, but I'm not sure how good your VB skills are and that method takes a bit more work.