I'm using a function to create an SQL string to select records and order them correspondingly. I'm using the following code:
strSELECT = "RCLSITES.*"
strFROM = "RCLSITES"
If LINKNUM = 5 Then
strSQL = "SELECT " & strSELECT & ", RCLSITES.rcllink, RCLSITES.rclstation "
strSQL = strSQL & "FROM " & strFROM
strSQL = strSQL & " ORDER BY " & "RCLSITES.rcllink, RCLSITES.rclstation;"
GoTo SQLState_Bld
End If
The string gets to the query fine, because I can go to the query and see the SQL string I've just placed there. When I run that string from the query it does exactly what I want it to. When I try to run the query from the form that I'm selecting my parameter from I get a message that says "qryRCLLINK.rclstation could refer to more than one table listed in the From clause of your SQL statements". I don't have duplicate Tables or fields. Any help would be appreciated.
Thanks,
Tony
strSELECT = "RCLSITES.*"
strFROM = "RCLSITES"
If LINKNUM = 5 Then
strSQL = "SELECT " & strSELECT & ", RCLSITES.rcllink, RCLSITES.rclstation "
strSQL = strSQL & "FROM " & strFROM
strSQL = strSQL & " ORDER BY " & "RCLSITES.rcllink, RCLSITES.rclstation;"
GoTo SQLState_Bld
End If
The string gets to the query fine, because I can go to the query and see the SQL string I've just placed there. When I run that string from the query it does exactly what I want it to. When I try to run the query from the form that I'm selecting my parameter from I get a message that says "qryRCLLINK.rclstation could refer to more than one table listed in the From clause of your SQL statements". I don't have duplicate Tables or fields. Any help would be appreciated.
Thanks,
Tony