Help with OpenForm code

gojets1721

Registered User.
Local time
Today, 09:29
Joined
Jun 11, 2019
Messages
430
I have listbox in a form which lists changes made to a record. I have code that lets the user click an entry in the listbox and it opens up a single view form with a more detailed view of the change. I want the code to open to that particular entry but also apply a filter as well so that the user can move to the other changes within the single view form.

Here's my code:

Code:
If Me.list.ListIndex > -1 Then
   DoCmd.OpenForm "frmChangeLogExpanded", , "ComplaintNumber = " & Me.txtComplaintNumber, OpenArgs:=Me.list.Column(0)
End If

Its not working though. It opens up to the right record but does not apply the filter so every change across every record can be accessed. Any suggestions? I can supply an example DB if this is confusing.
 
Do you have a copy of the database with only a few records that illustrate the issue that you could post?
 
Do you have a copy of the database with only a few records that illustrate the issue that you could post?
Of course. See attached.

So when you open it up, hit the green change log. And then hit one of the entries on the list box. It opens up to the right entry, but also includes complaint number 6's entries. I only want complaint number 5 entries to show because that is what record the user is specifically on.

Appreciate any help! TY
 

Attachments

I moved to record 2, hit change, then clicked Open Change Details and got the following.
changeLogRelated.png
 

Users who are viewing this thread

Back
Top Bottom