Open Form, based on a table, to specific record from another form



I have a LOANS table that has a list of loan details for different
borrowers. I have a main switchboard with a LOANSELECT combo box
(that displays a list of borrower last names and loan numbers). I'd
like to be able to have a user click on the say, RECEIVE PAYMENT
button that will open the payments form. This form should open to the
loan that was selected from the LOANSELECT box. This form also has a
box on it to switch to different loan, so I can't use a query or a
DoCmd.OpenForm, as this only passes the selected record to the second
form.

I've been trying to get the FindFirst command to work, but can't seem
to do it. Here's what I've got as code for the second form.

Private Sub Form_Load()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[LoanID] = " & Str(Nz(Forms!SWITCHBOARD.LoanSelect,
0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

I greatly appreciate any help that anyone can give and forgive my
novice ability. Thanks!

.


Quantcast