Heatshiver
Registered User.
- Local time
- Today, 22:53
- Joined
- Dec 23, 2011
- Messages
- 263
I have a button that checks two fields in a table to see if a user has used a date in the past. The fields are UserID and Days.
The code is:
The purpose is so that the user never repeats the same day twice. The problem is that it seems to find other user ID and check that as well. The main form does pull the user ID from another form... I have tried specifying the field from that form in the DCount, but the same results occur.
I have one other user ID. I feel like it's either checking all user IDs, or it still thinks it is using the other user ID. Everything else seems to work, including a new (unused) date with either user ID, and displays as such in the table data.
Any help would be much appreciated!
The code is:
Code:
DCount("[UserID]", "tblGenSum", "[UserID]= '" & Me.UserID & "' And [Days]= #" & Me.txtNewDate & "#") > 0
The purpose is so that the user never repeats the same day twice. The problem is that it seems to find other user ID and check that as well. The main form does pull the user ID from another form... I have tried specifying the field from that form in the DCount, but the same results occur.
I have one other user ID. I feel like it's either checking all user IDs, or it still thinks it is using the other user ID. Everything else seems to work, including a new (unused) date with either user ID, and displays as such in the table data.
Any help would be much appreciated!