Opening a form and moving to a specific subform

R

Robert Ross

I have a DB with two linked tables (Demographics and
Claims) linked via SSN (one to many). I have a form that
lists open claims via SSN and Claim ID. I want to have a
Find button open the Demographic and display a specific
claim for that demographic. Here is the code from my Find
button:
----------------------------------------
Private Sub FIND_Click()
On Error GoTo Err_FIND_Click

Dim stDocName As String
Dim stLinkCriteria As String
Dim stSubL

stDocName = "Averts"
stLinkCriteria = "[ssn]=" & "'" & [Forms]![Follow Up
List Form]![ssn] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria,
acFormEdit, acWindowNormal

With Forms.Averts.Claims.Form.RecordsetClone
.findfirst "[Claimid]=" & "'" & [Forms]![Follow Up
List Form]![Claim ID] & "'"
If Not .nomatch Then
Forms!Averts.Claims.Form.Bookmark = .Bookmark
End If
End With

Exit_FIND_Click:
Exit Sub

Err_FIND_Click:
MsgBox Err.Description
Resume Exit_FIND_Click

End Sub----------------------------------------
What I need it to do is open the Main form (Averts) and
open the specific SSN listed on my search form (Follow Up
List Form). Then I need it to open the specific Claim on
the Subform (Claims) that is listed on the search form.

Please help!

THX!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top