Heatshiver
Registered User.
- Local time
- Tomorrow, 00:36
- Joined
- Dec 23, 2011
- Messages
- 263
I have a field and a button that allows the use to put in a new date, click the button, and create a new record with that new date.
When the button is clicked the following DCount VBA is implemented:
If DCount("[UserID]", "tblGenSum", "[UserID]= '" & Me.UserID & "' And [Days]= #" & Me.txtNewDate & "#") > 0 Then
MsgBox "This user has already used this date."
Me.txtNewDate.Value = ""
Exit Sub
End If
So if the same UserID is and date has already been used, the message is meant to display and exit sub.
My problem is that it will not do this, as it will add the same date already used previously.
What am I doing wrong and how can I fix it? Thanks for the help.
When the button is clicked the following DCount VBA is implemented:
If DCount("[UserID]", "tblGenSum", "[UserID]= '" & Me.UserID & "' And [Days]= #" & Me.txtNewDate & "#") > 0 Then
MsgBox "This user has already used this date."
Me.txtNewDate.Value = ""
Exit Sub
End If
So if the same UserID is and date has already been used, the message is meant to display and exit sub.
My problem is that it will not do this, as it will add the same date already used previously.
What am I doing wrong and how can I fix it? Thanks for the help.