query explanation

am_sarath

Registered User.
Local time
Today, 23:29
Joined
Sep 19, 2001
Messages
29
hello,

could somebody please tell me what exactly the following lines of code is doing?

Set rsValidate = projectdb.OpenRecordset("Select * from raw_risks where cluster_id=" & lst_clust.Value & " and raw_risk_description Like '" & txt_raw_risk & "'")

If rsValidate.EOF Then
-----------

thank you
 
Set rsValidate = projectdb.OpenRecordset("Select * from raw_risks where cluster_id=" & lst_clust.Value & " and raw_risk_description Like '" & txt_raw_risk & "'")

If rsValidate.EOF Then
-----------
It is opening a recordset (rsValidate), which takes all records from a table or query called "raw_risk" which have fields called "cluster_id" that correspond to a value or values displayed in a list box "lst_cluster" (displayed on a form) AND fields that correspond to a raw_risk_description displayed in a text box "txt_raw_risk" , (also probably on the same form).

The last line checks if there are any records. If End Of File is TRUE, there aren't any.
 

Users who are viewing this thread

Back
Top Bottom