JustPunkin
Registered User.
- Local time
- Today, 17:29
- Joined
- Jan 8, 2009
- Messages
- 38
I'm in the process of writing a query to search for multiple attributes of our projects.
I've been able to write the code to run the query for all of the information I need that is in my main table. I now need to add a bit of code to search for some information that is in a secondary table. The tables are linked by a key number.
I can get this to work if I search criteria in one or the other table, but not in both. I get an error "Runtime Error 3296 Join Expression Not Supported"
This is the beginning of my code. Can anyone help me figure out what I'm doing wrong.
Thanks
I've been able to write the code to run the query for all of the information I need that is in my main table. I now need to add a bit of code to search for some information that is in a secondary table. The tables are linked by a key number.
I can get this to work if I search criteria in one or the other table, but not in both. I get an error "Runtime Error 3296 Join Expression Not Supported"
This is the beginning of my code. Can anyone help me figure out what I'm doing wrong.
Thanks
Code:
Private Sub cmdOK_Click()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim strSQL As String
Set db = CurrentDb
Set qdf = db.QueryDefs("qryMechFeatureSearch")
strSQL = ""
strSQL = strSQL & "SELECT [Mechanical Features].*, [General Project Information].*"
strSQL = strSQL & "FROM [Mechanical Features] "
strSQL = strSQL & "INNER JOIN [General Project Information]"
strSQL = strSQL & "ON [Mechanical Features].[Key #] = [General Project Information].[Key Number]"