SubForm RecordSource

vik808

Registered User.
Local time
Yesterday, 23:30
Joined
Jul 31, 2008
Messages
16
Hi I have a button on a main form that is used to switch the recordsource of a subform....

Private Sub cmdSwitchNER_Click()

If Me!cmdSwitchNER.Caption = "Normal NER" Then
Me!cmdSwitchNER.Caption = "Connector NER"
Me!frmNextEvent_sub.Form.RecordSource = "qsel_NER_Normal"
'MsgBox Me!frmNextEvent_sub.Form.RecordSource
ElseIf Me!cmdSwitchNER.Caption = "Connector NER" Then
Me!cmdSwitchNER.Caption = "Normal NER"
Me!frmNextEvent_sub.Form.RecordSource = "qsel_NER_Labels"
'MsgBox Me!frmNextEvent_sub.Form.RecordSource
End If
End Sub

This works in Acces2003 but not in 2007.... Any ideas?
Thanks!!
 
You can try fully qualifying your parent form in your subform reference.

Instead of this:
Me!frmNextEvent_sub.Form.RecordSource

Use this:
Forms!ParentFormName!frmNextEvent_sub.Form.Recordsource =
 
I tried to fully qualify but no dice. No error either. Seens like it will switch the recordset over once but not when I click the button again to switch back. I'm sure I'm missing something simple here
 
Did you try stepping through your code? Perhaps the event is not firing. If not, you should remove that procedure from the module, exit the database and go back into the form and put the procedure back in.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom