matt beamish
Registered User.
- Local time
- Today, 06:02
- Joined
- Sep 21, 2000
- Messages
- 215
Hello folks. I've been battling with this and can't see what I am doing wrong. I am trying to open form2 from form1. Form2 is not bound but has an unbound search that allows users to open it from a menu and find the records they need. I want to open Form2 and pass a text value from Form1 to the unbound control, and then filter a subform (Form3) to another value being picked up from a control on Form1
I am failing at the first, and although the Form2 is opening, I cannot populate the unbound control.
Here is my code
My debug.print is
Stlinkcriteria: [FullAccessioncbo]="LMARS_XA72025" StFilter: [SampRecID] = 10151
I've tried running with and without the filter on the subform, but my unbound control is not populating. The unbound control is a combo box named FullAccessioncbo
Can anyone help me please?
thanks
I am failing at the first, and although the Form2 is opening, I cannot populate the unbound control.
Here is my code
Code:
Private Sub Command17_Click()
On Error GoTo Err_Command17_Click
Dim stDocName As String
Dim stLinkCriteria, stFilter As String
stDocName = "F_SampleFractionRecordsAcc"
stLinkCriteria = "[FullAccessioncbo]=" & Chr(34) & [FullAccessioncbo] & Chr(34)
stFilter = "[SampRecID] = " & [SampleRecIDcntrl]
Debug.Print "Stlinkcriteria: " & stLinkCriteria & " StFilter: " & stFilter
DoCmd.OpenForm stDocName, , , stLinkCriteria
'Forms!F_SampleFractionRecordsAcc!F_FractionRecords.Form.Filter = stFilter
'Forms!F_SampleFractionRecordsAcc!F_FractionRecords.Form.FilterOn = True
Exit_Command17_Click:
Exit Sub
My debug.print is
Stlinkcriteria: [FullAccessioncbo]="LMARS_XA72025" StFilter: [SampRecID] = 10151
I've tried running with and without the filter on the subform, but my unbound control is not populating. The unbound control is a combo box named FullAccessioncbo
Can anyone help me please?
thanks