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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query result field to update the table

Status
Not open for further replies.

waymond

Programmer
Mar 1, 2005
118
US
I have a query which gets the result from user selecting three combo boxes. The results of the one field needs to be inserted into a table called Object and the field is as400narr. The query is only keeps the result after the user make the choices of the combo box this is urgent is there anyway simply to do this

thank You
 
This the code in the query besides where I tried the insert statement which has syntax errors can an insert work from the query. Please someone help this is urgent

SELECT OBJP1.ODOBTX
FROM OBJP1
WHERE (((OBJP1.ODLBNM)=[Forms]![Object]![cboODLBNM]) AND ((OBJP1.ODOBNM)=[Forms]![Object]![cboODOBNM]))
INSERT INTO OBJECT(as400narr) values OBJP1.ODOBTX)

tony
 
something like:

INSERT INTO OBJECT (as400narr) values (SELECT OBJP1.ODOBTX
FROM OBJP1
WHERE (((OBJP1.ODLBNM)=[Forms]![Object]![cboODLBNM]) AND ((OBJP1.ODOBNM)=[Forms]![Object]![cboODOBNM])))
 
thank you where should I put this code
 
without knowing more about what you are doing and why and what your form is like, I don't have a clue where you should put it.

Maybe in the on-close event of the form or the on-select event of the combo box?



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top