Sub forms changing source code

delboy2

Registered User.
Local time
Today, 02:08
Joined
Oct 10, 2003
Messages
12
Hi Please help !
I have a form on which I require several sub forms I have created controls on The sub forms to change the sourceobject of unbound sub forms.
However I am having problems seting the link criteria to come from the previous sub form
It does work when using normal forms and using the following code to open the next form but i cant get it to work on the sub forms any Ideas?

Private Sub Command5_Click()
On Error GoTo Err_Command5_Click

Dim stDocName As String
Dim stLinkCriteria As String


stLinkCriteria = "[POSTCODE]=" & "'" & Me![PostCodeSearch] & "'"



stDocName = "frmSubscriberPostCodeList"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command5_Click:
Exit Sub

Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click

End Sub

Hope this makes sense
 
Subforms aren't opened separately. They are opened when their parent form is opened so you can't filter them this way. Subforms are sync'd with their parent forms via the master/child links property.
 

Users who are viewing this thread

Back
Top Bottom