AndAlso equivalent in VBA?

Still asks for End Date as it did before with the other tries.
 
#20 Didn't you play Battleships when kid? Isn't it much more (lengthy) fun playing the remote version, where the two players don't have the same grid, and there is an unlimited number of squares? :D
 
It will only do the lookup if it's not locked:

If Me.[End Date].Locked = False Then b = (DCount("*", "tblDailyReport", "[Days] = #" & Me![End Date] & "#") > 0)

Therefore it is not locked when it is checking whether it exists. There's no doubt about that.
 
#20 Didn't you play Battleships when kid? Isn't it much more (lengthy) fun playing the remote version, where the two players don't have the same grid, and there is an unlimited number of squares? :D

I've got a great idea for a new PC game:

Exactly like minesweeper but without the numbers. It just tells you when you've hit a mine. :D
 
There is no error number, it gives me the MsgBox that states to put in an End Date. I guess that would be an logic error.
 
Either you have some other code referring to its value or it isn't locked:

If Me.[End Date].Locked = False Then ...

It won't do the bit after Then if it is.

I trust you are aware that locked is not the same as disabled (greyed out).
 
Put
MsgBox IIf(Me.[End Date].Locked,"Locked", "Not Locked")
somewhere in the code.
If it says Locked then it must be some other code asking for the value.
 
It does say locked. I'll have to keep checking, this is puzzling.
 
Put a break point at the start of the sub and step through it (F8). See which line produces the message asking for its value.
 
It took me forever, but I got it working. I first put in a statement that stated if End Date was locked then 'a' was False. The I used 'if condition a, then condition b'.
 
After more testing, it is actually not working. It completely ignores the End Date whether or not it is locked now.
 
I wonder if it's something to with having the control named [End Date]. Try changing it to EndDate and change the code accordingly.

I never have spaces in control names so I don't know whether that would cause these sorts of problems.
 

Users who are viewing this thread

Back
Top Bottom