title: MS Access: How to open form via command button based on current record?
body: <p>Let's say I've got two tables, <code>tblA</code> and <code>tblB</code>, that have a 1:n relationship, i.e. for a given record in tblA there can be many records in tblB.</p>
  
  <p>Now I have a form, <code>frmA</code>, that is based on tblA. On this form there is a command button that opens a second form, <code>frmB</code>, that is based on <code>tblB</code>. Now I want that second form <code>frmB</code> to only display records from <code>tblB</code> that match the current record from <code>tblA</code>.
  I found that there is a built-in way (I use Access 2010) that filters the data from <code>tblB</code>. But since within <code>frmB</code> I need to do some more stuff based on the current record, this is not enough.
  How do I do this then?</p>
  
  <p>I thought of creating a query, <code>qryAB</code>, that does an inner join and has a parameter to select a certain record from <code>tblA</code>. But how would I pass something to this query to use as a parameter from the on-click macro (or vba) for my command button?</p>