Hollis, Virginia
hollisvj at pgdp.usec.com
Mon Oct 3 08:22:00 CDT 2005
Still getting the same error, Invalid SQL statement. It highlights the first part of the statement. "SELECT MechanismID, FailureMechanism FROM tbl_mechanism WHERE MechanismID IN " "SELECT MechanismID, FailureMechanism FROM tbl_mechanism WHERE MechanismID IN " (SELECT MechanismID FROM tbl_IdentMechanism WHERE IdentID=" & me.cboMechanism &")"; ________________________________ Probably the line continuation character (" _ ") ... Its only for code, not a control property. Sorry, that's on me; as I got to the right edge of the email, I put it in out of habit. Make the whole sql string string into one line. Hth Steve -----Original Message----- From: accessd-bounces at databaseadvisors.com <http://databaseadvisors.com/mailman/listinfo/accessd> [mailto:accessd-bounces at databaseadvisors.com <http://databaseadvisors.com/mailman/listinfo/accessd> ] On Behalf Of Hollis, Virginia Sent: Monday, October 03, 2005 8:33 AM To: accessd at databaseadvisors.com <http://databaseadvisors.com/mailman/listinfo/accessd> Subject: [AccessD] Combo to Combo Thanks so much, I think that is what has me thrown off on this whole thing - the repeated values in the tables. I could not figure out a way to make them match without repeating everything. Steve, When I used the Select, I get an error - Invalid SQL statement, Delete, Insert, Or Select... It highlights the first part of the statement, to the IN. What am I doing wrong? tbl_Identification (Alarm, Battery, etc) IdentID (autonumber) Identification (text) tbl_Mechanism (Age, Wear, etc) MechanismID (autonumber) FailureMechanism (text) tbl_IdentMechanism IdentID (number) MechanismID (number)(these are the primary key numbers from the Identification & Mechanism tables) The form has 2 combos, cboMechanism & cboIndentifcation "SELECT MechanismID, FailureMechanism FROM tbl_mechanism WHERE MechanismID IN " & _ " (SELECT MechanismID FROM tbl_IdentMechanism WHERE IdentID=" & me.cboMechanism &")"; Virginia