Hello,
could some body please explain me the following code, like what all the queries or functions used.Your help would be highly appreciated, this would be really useful for me.
Many thanks.
------------------------------------
Private Sub cmdSave_Click()
Dim rs As Recordset
Dim rs1 As Recordset
If IsNull(txtStakeholder) Or Trim(txtStakeholder) = "" Then
MsgBox "Enter a stakeholder"
txtStakeholder.SetFocus
Exit Sub
End If
Set rs = raptordb.OpenRecordset("Select * from stakeholders where stakeholder_name " & IIf(IsNull(txtStakeholder), "Is Null", " Like '" & txtStakeholder & "'"))
If Not rs.EOF Then
MsgBox "Stakeholder name already exsist"
txtStakeholder.SetFocus
Exit Sub
Else
rs.AddNew
rs.Fields(1) = txtStakeholder
rs.Update
End If
MsgBox "Information saved", vbInformation
txtStakeholder = ""
lst_stakeholder.Requery
End Sub
could some body please explain me the following code, like what all the queries or functions used.Your help would be highly appreciated, this would be really useful for me.
Many thanks.
------------------------------------
Private Sub cmdSave_Click()
Dim rs As Recordset
Dim rs1 As Recordset
If IsNull(txtStakeholder) Or Trim(txtStakeholder) = "" Then
MsgBox "Enter a stakeholder"
txtStakeholder.SetFocus
Exit Sub
End If
Set rs = raptordb.OpenRecordset("Select * from stakeholders where stakeholder_name " & IIf(IsNull(txtStakeholder), "Is Null", " Like '" & txtStakeholder & "'"))
If Not rs.EOF Then
MsgBox "Stakeholder name already exsist"
txtStakeholder.SetFocus
Exit Sub
Else
rs.AddNew
rs.Fields(1) = txtStakeholder
rs.Update
End If
MsgBox "Information saved", vbInformation
txtStakeholder = ""
lst_stakeholder.Requery
End Sub