Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL statement

Status
Not open for further replies.

phpatrick

Programmer
Jul 9, 2006
72
BE
Code:
DoCmd.RunSQL "INSERT INTO T_03_TIME ( refCCT ) SELECT T_03_TIME.refCCT FROM T_03_TIME WHERE (((T_03_TIME.refCCT)=Forms![F_00_AR_FICHE_DAG]![SELECTWKN].Column(0)));"

Hello,

He should add a new record with the value of a drop down box, however, he said my syntax (the drop down box) is not correct.

thanks in advance for any help
 
Firstly you have the code within the quotes and so to me looks like you are seaching for
Forms![F_00_AR_FICHE_DAG]![SELECTWKN].Column(0)))
as the actual thing you are trying to match!

try...
Code:
DoCmd.RunSQL "INSERT INTO T_03_TIME ( refCCT ) SELECT T_03_TIME.refCCT FROM T_03_TIME WHERE (((T_03_TIME.refCCT)=" & Forms![F_00_AR_FICHE_DAG]![SELECTWKN].Column(0))) & ";"

also if you have a select list and an item is selected the value of the select list should be what was selected so you might only need
Code:
DoCmd.RunSQL "INSERT INTO T_03_TIME ( refCCT ) SELECT T_03_TIME.refCCT FROM T_03_TIME WHERE (((T_03_TIME.refCCT)=" & Forms![F_00_AR_FICHE_DAG].[SELECTWKN)) & ";"


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top