Combo Box Stops Working after Passing Data from Another Form

C

cp2599

I have a combo box on a Family form which works properly – select a
family and the attributes for that family displays on the form;
however, after I successfully open this form from a Find Family form,
the combo box stops working. Only the data of the family that was
passed from the Find Form to the Family form appears on the form even
after I select another family. Any help you can give me will be
appreciated. I’m stumped.

Row Source Type of combo box is Table/Query
Row Source is SELECT tblFamily.idnFamilyID, tblFamily.chrFamilyName,
tblFamily.chrApplicantFirstName, tblFamily.chrApplicantLastName,
tblFamily.chrCoApplicantFirstName, tblFamily.chrCoApplicantLastName
FROM tblFamily ORDER BY tblFamily.chrApplicantLastName;
Bound column is 1

After update of combo box has this code:
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[idnFamilyID] = " & Str(Nz(Me![Combo88], 0))
If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
End If

Code for opening the Family form from the Find Family form:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmFamily"

stLinkCriteria = "[idnFamilyID]=" & Me![idnFamilyID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
R

ruralguy via AccessMonster.com

stDocName = "frmFamily"

stLinkCriteria = "[idnFamilyID]=" & Me![idnFamilyID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

The above lines puts a FILTER on the frmFamily form which limits the
RecordSet of the form. It would be better to pass the idnFamilyID in the
OpenArgs argument of the OpenForm command and then catch it in the OnLoad
event and find the record there.

I have a combo box on a Family form which works properly – select a
family and the attributes for that family displays on the form;
however, after I successfully open this form from a Find Family form,
the combo box stops working. Only the data of the family that was
passed from the Find Form to the Family form appears on the form even
after I select another family. Any help you can give me will be
appreciated. I’m stumped.

Row Source Type of combo box is Table/Query
Row Source is SELECT tblFamily.idnFamilyID, tblFamily.chrFamilyName,
tblFamily.chrApplicantFirstName, tblFamily.chrApplicantLastName,
tblFamily.chrCoApplicantFirstName, tblFamily.chrCoApplicantLastName
FROM tblFamily ORDER BY tblFamily.chrApplicantLastName;
Bound column is 1

After update of combo box has this code:
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[idnFamilyID] = " & Str(Nz(Me![Combo88], 0))
If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
End If

Code for opening the Family form from the Find Family form:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmFamily"

stLinkCriteria = "[idnFamilyID]=" & Me![idnFamilyID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
 

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