I'm using VBA to try and dynamically change a rowsource query:
SELECT Teams.TeamName, Teams.Sport FROM Teams WHERE (((Teams.Sport)="NBA"));
In VBA as follows:
Select Case Sport.Value
Case "NBA"
Team1.RowSource = "SELECT Teams.TeamName, Teams.Sport FROM Teams WHERE (((Teams.Sport)="NBA")); "
As you can see the "" marks mess everything up. I need NBA to be in "" for the query to work in access but VBA won't have it. Is there a way around this? Please Help, much appreciated. R
SELECT Teams.TeamName, Teams.Sport FROM Teams WHERE (((Teams.Sport)="NBA"));
In VBA as follows:
Select Case Sport.Value
Case "NBA"
Team1.RowSource = "SELECT Teams.TeamName, Teams.Sport FROM Teams WHERE (((Teams.Sport)="NBA")); "
As you can see the "" marks mess everything up. I need NBA to be in "" for the query to work in access but VBA won't have it. Is there a way around this? Please Help, much appreciated. R