Avatar of marku24
marku24
Flag for United States of America asked on

Change Record Source in VBA based on Check Box Result

Changing a subform's record source based on a check box result through VBA.  I want to change the record source from a TABLE to a QUERY but assume the syntax of calling each is wrong.  see below:


Dim strSource As String
 
    If chkPending = 0 Then
    strSource = "tbl_MAP Product Pricing-Repository"
    End If
 
    If chkPending = 1 Then
    strSource = "sqryOFCDEPTLedgerBalances_NoPending_2"
    End If
  
   
  Form_frmOFCDEPTLedgerBalances_subform.RecordSource = strSource

VBA

Avatar of undefined
Last Comment
marku24

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gunter Avenius

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
marku24

ASKER
so simple yet i would have never figured that out.  thank you 
Your help has saved me hundreds of hours of internet surfing.
fblack61