Change Recordsource with VBA

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
 
G

Guest

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?
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top