Steve Conklin
developer at ultradnt.com
Mon Oct 3 09:00:07 CDT 2005
It looks ok to me, but if theres a stray hard return in the propertry it
could break.
Paste the string into query design, you'll get better error message if its
wrong
SELECT MechanismID, FailureMechanism FROM tbl_mechanism WHERE MechanismID IN
(SELECT MechanismID FROM tbl_IdentMechanism WHERE IdentID=" &
me.cboMechanism & ")";
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Hollis, Virginia
Sent: Monday, October 03, 2005 9:22 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Combo to Combo
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
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com