How can I fine a name in a table and compare it?
If the name is in the table, continue with FORWARD. Else, then write information to a different table.

Approver is a name in the record that is doing the work. I wanted to see if this person is authorized by looking at a list of names in tblFont.

Set Dbe = Application.CreateObject("DAO.DBEngine.36")

Set MyDB = Dbe.Workspaces(0).OpenDatabase" _
Set Rst = MyDB.OpenRecordset("select * from tblFont")
SearchText = name

If searchtext = Approver1 Then
Else if searchtext <> Approver Then
UserProperties.Find("txtstatus").Value = "Finished"
UserProperties.Find("jobtype").Value = "Unauthorized User"
UserProperties.Find("Approver1").Value = vrUser
End If

Not sure if this is enough info. - MS Access XP, Using this script in MS Outlook form. This is run using a command button.

Set Rst = MyDB.OpenRecordset("select * from tblFont where fieldname=SearchText") <-- not sure if this is going to be an integer or string so format it properly.

Then do if row count > 0 do something else.

If I were you I would start changing everything from dao to ado for speed and upgradability.

dim conn as adodb.connection
dim rs as adodb.recordset

set conn = new adodb.connection
set rs = new adodb.recordset {connectionstring}
mysql = "select name,pass from tblFont where name='" & reviver1 & "';" Mysql,conn,3,3,1

if not rs.eof then
     do while not rs.eof
         compare blah, blah > blah
label1.caption="No Records Found."
end if
This article has been dead for over six months. Start a new discussion instead.