boomer1974
MIS
Good day all,
I am having a terrible time with the following code. I keep getting a "type mismatch error" If I use an "=" (without all the wildcard syntax) instead of "like" it works fine but I really need the "like statement" any help would be greatly appreciated. Here is the code.
Public Sub Warning_Done()
Dim myuser As Integer
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Select * from tblWarning"
myuser = Forms!frmCalender!User
rst.MoveFirst
Do Until rst.EOF = True
If rst!UserID = myuser Then
MsgBox "table: " & rst!warningtype
MsgBox "forms: " & Forms!frmCalender!warning
If rst!warningtype.Value Like "chr(34)" * " & Forms!frmCalender!warning.value & chr(34)" * "" And rst!warningDone = False Then
Forms!frmCalender!warning.Visible = True
End If
End If
rst.MoveNext
Loop
End Sub
thanks,
Boomer
I am having a terrible time with the following code. I keep getting a "type mismatch error" If I use an "=" (without all the wildcard syntax) instead of "like" it works fine but I really need the "like statement" any help would be greatly appreciated. Here is the code.
Public Sub Warning_Done()
Dim myuser As Integer
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Select * from tblWarning"
myuser = Forms!frmCalender!User
rst.MoveFirst
Do Until rst.EOF = True
If rst!UserID = myuser Then
MsgBox "table: " & rst!warningtype
MsgBox "forms: " & Forms!frmCalender!warning
If rst!warningtype.Value Like "chr(34)" * " & Forms!frmCalender!warning.value & chr(34)" * "" And rst!warningDone = False Then
Forms!frmCalender!warning.Visible = True
End If
End If
rst.MoveNext
Loop
End Sub
thanks,
Boomer