First I will show you my sql, just in case it is some obvious syntax error on my part:

"INSERT INTO tblResults(status, enthusiasm, communication, knowledge, interaction,
                                   organization, responsiveness, instID, comment)" & _
 "VALUES(""" & status & """, """ & enthusiasmB & """, """ & communicationB & """, """ & _
                     knowledgeB & """, """ & interactionB & """, """ & organizationB & """, """ & _
                     responsivenessB & """, (" & getFacIDB & "), """ & _
                     comment & """)"

where

Dim getFacIDB As String = "SELECT instID FROM tblInstructor" & _
                                " WHERE firstName = '" & firstNameB & "'"

So if you can't tell what I am trying to do is pull the id from another table so that I have a valid faculty reference between the tables. What I am looking for is a Select statement nested inside an Insert statement.

The error I am getting is "Unspecified error" on:
dr = resultsCommandA.ExecuteNonQuery

Any help is appreciated.

Instead of nesting the queries I pulled them apart and set the Select statement to a variable and then called my sql for the insert statement. If anyone has any better ideas just let me know I am open to suggestions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.