Hi,
I have a form that I want to check a table to see if it has any matching fields (WinTyp and WinD) WinTyp is a text field and WinD is a date field. I can't get the syntax right for "set rs"
Any help is appreciated!
I have a form that I want to check a table to see if it has any matching fields (WinTyp and WinD) WinTyp is a text field and WinD is a date field. I can't get the syntax right for "set rs"
Code:
Private Sub Search_Click()
Me.Visible = False
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Select WinTyp, WinD from tblWin where (WinTyp = 'WALK') AND (WinD = " &
Forms!fdlgPickWalkWinners!TxtStart & ""))
If Not rs.EOF And Not rs.BOF Then
MsgBox ("Winner's Already Picked! Check Your Start Date!")
Else
MsgBox ("adding winner")
DoCmd.OpenQuery "qppWALKWinners", acNormal, acEdit
DoCmd.CLOSE acQuery, "qppWALKWinners"
End If
End Sub
Any help is appreciated!