Expand my Community achievements bar.

Populating form from Access Database

Avatar

Level 10
Hi,



I am trying to get the following script to populate a form. I have gone through recent threads. Here I have put in the single quotation marks around RedProject, however it comes back with a syntex error.



if (Len(Ltrim(Rtrim(form1.#subform[0].RedQuery.RedProject.rawValue))) > 0) then

//Change the commandType from TABLE to TEXT. TEXT is the equivalent of SQL Property



$sourceSet.Red_List.#command.query.commandType = "text"



//Set the Select Node. Select in this case will be whatever the SQL Property you want.

$sourceSet.Red_List.#command.query.select.nodes.item(0).value = Concat("Select * from 02_Red_Hazard_List Where RedProject = "', Ltrim(Rtrim(form1.#subform[0].RedQuery.RedProject.rawValue)) ,'"")



//Reopen the Dataconnection

$sourceSet.Red_List.open()

endif



If I leave the single quotation marks out, (as per a previous example which works????), then the script burns "Error: open operation failed. [Microsoft][ODBS Microsoft Access Driver] Too few parametrs. Expected 1."



Any ideas please ;-)



Thanks Niall
0 Replies