Programmically Setting Referencing A Query As A RecordSource

P

PC User

I'm not very good at converting a query into VBA, so I'm looking for a
way to reference two update queries that select and deselect
checkboxes. I want to change the recordsource on a subform by using
command buttons on the parent form. I get an error on the recordsource
statement. Can someone help me?

Dim strSQL As String
Dim Frm As Form
Dim sfN As Form 'Program Notification SubForm
Set Frm = Forms!frmMainEntry.Form
Set sfN = Frm.[fctlNotifications].Form
strSQL = "qselNotificationSelectionYes"
sfN.RecordSource = strSQL
sfN.Requery

Thanks,
PC
 
A

Allen Browne

Try:
Me.[fctlNotifications].Form.RecordSource = "qselNotificationSelectionYes"
 

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