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

SQL SELECT based on values from another row

Status
Not open for further replies.

DRSinclair

Programmer
Jun 15, 2005
9
GB
Hi,

I have a table containing various contact address, on a sales invoice document i have i would like to be able to append the value of a text control called BuCode onto a Select statement to return the correct contact name, i have tried this in the Finish and OnRow methods, but i get errors any ideas?

me.datavalue=SELECT CONTAC FROM ccCons WHERE Con_CODE='000000000' & (BuCode)
 
Why not do it in the Sql itself?
Specifically as a 'calculated' field
 
Thanks for the reply, i fixed this by putting it in the BuildFromRow method before the Super call and changed the text to...

ExecuteSQL="SELECT CONTAC FROM ccCONS WHERE Con_Code='000000000" & BUCode & "'"

Cheers
Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top