S
Stuart Jack via AccessMonster.com
Hi
I am having a problem with OpenForm arguments, basically I want to dbl click
on a listbox 'frmAuditTrail' and use the value in Column(2) of the listbox
for the OpenForm argument, in order to filter the form to the ID of the
patient I have dbl clicked on.
frmPatient is the form I want to open, filtered to the correct patient, I am
using the following code to do this in the dbl click event of frmAuditTrail --
Private Sub lstView2_DblClick(Cancel As Integer)
Dim strValue As String
strValue = Me.lstView2.Column(2)
DoCmd.OpenForm "frmPatient", , , "[PtID] =" & strValue
End Sub
The form opens but contains no records, in other words seems to be filtered
on nothing, on checking the code in debugger window I can see that the
correct PtID is being picked up by strValue, but for some reason is not being
passed through.
Any ideas anyone?
Thanks
Stuart
I am having a problem with OpenForm arguments, basically I want to dbl click
on a listbox 'frmAuditTrail' and use the value in Column(2) of the listbox
for the OpenForm argument, in order to filter the form to the ID of the
patient I have dbl clicked on.
frmPatient is the form I want to open, filtered to the correct patient, I am
using the following code to do this in the dbl click event of frmAuditTrail --
Private Sub lstView2_DblClick(Cancel As Integer)
Dim strValue As String
strValue = Me.lstView2.Column(2)
DoCmd.OpenForm "frmPatient", , , "[PtID] =" & strValue
End Sub
The form opens but contains no records, in other words seems to be filtered
on nothing, on checking the code in debugger window I can see that the
correct PtID is being picked up by strValue, but for some reason is not being
passed through.
Any ideas anyone?
Thanks
Stuart