Change Recordsource with VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I put a toggle button on my form that I want use to switch the recordsource
of my form.

Here's the code I am trying to use:

Private Sub tgl_Active_Pending_or_Comp_Click()

If Forms!frm_Implementation_Pipeline.RecordSource = "qry_Implementation_Frm"
Then
Forms!frm_Implementation_Pipeline.RecordSource =
"qry_Implementation_Frm_Complete"
ElseIf Forms!frm_Implementation_Pipeline.RecordSource =
"qry_Implementation_Frm_Complete" Then
Forms!frm_Implementation_Pipeline.RecordSource = "qry_Implementation_Frm"
End If

End Sub

Can someone please tell me what I'm doing wrong? I've looked in a couple of
books and searched the Internet and I can't figure it out.

Thank you,
Rachel
 
You question is like "Doctor, I don't feel good. Whats wrong with me?"

What error are you getting and what line causes the error?
 
Yea, that about sounds like me at the doctor's. Sorry about that.

I just played around with it a little more and I'm not sure what I did
differently but it's working now. I may have had a slightly wrong control
name, I guess.

Thank you for your response though. I really appreciate it.

Thanks,
Rachel
 
Back
Top