Setting the record source of a from dynamically
I have a form with a drop down. When the user changes the value in the combo the record source should change to a different table. However, when I run this code I get the following error:
Runtime Error 2107:
"The value you entered doesn't meet the validation rule defined for the field or control"
Here's the code:
Select Case Me.cmbCard.Column(0)
Case Is = "1"
'Set the record source to the AMEX table
Me.RecordSource = "tblAMEX_Main"
Exit Sub
End Case
I have a form with a drop down. When the user changes the value in the combo the record source should change to a different table. However, when I run this code I get the following error:
Runtime Error 2107:
"The value you entered doesn't meet the validation rule defined for the field or control"
Here's the code:
Select Case Me.cmbCard.Column(0)
Case Is = "1"
'Set the record source to the AMEX table
Me.RecordSource = "tblAMEX_Main"
Exit Sub
End Case