Warning Message Removal

gsandy

Registered User.
Local time
Today, 23:17
Joined
May 4, 2014
Messages
104
I have a form to enter data into a table. On completion of entering the last of a series of records there is always a blank form. On closing form there are two messages - "You must enter a value ......" and "You cant save this record at this time". How can I stop these messages appearing? Thanks Sandy.
 
Do you have any code in the forms On Current event
 
Yes there is code linked to the textboxes that the "You must enter a value ...." refers to.
 
Code:
Private Sub Week_Ending_Exit(Cancel As Integer)
Week_No = DatePart("ww", [Week_Ending], 1)
End Sub
The above Week_Ending is the first message referred to.

The second message refers to textbox which relates to another textbox which has a Control Source Expression with a Dlookup.
 
Can you comment out the code, just to confirm that it is this that causes the messages, then we can look at the best way to prevent them.
I'm off to bed very soon but will stop by and take another look tomorrow eve.
 
I commented out the code relating to Week_Ending and the two messages did not appear. Hear from you tomorrow, Sandy.
 
I commented out the code relating to Week_Ending and the two messages did not appear. Hear from you tomorrow, Sandy.
Good. Try:
= DatePart("ww", [Week_Ending], 1)
as the Default Value property setting for the text box called Week_No
 
Hi Bob. Did that but the value in textbox Week_No returned "0" and the message popped up again.
 
I've just been thinking a bit more about this. You just need to use your expession:
= DatePart("ww", [Week_Ending], 1)
as the Control Source property setting of the text box called Week_No which is a calculated value and should not be saved in the bound record but be calculated whenever and wherever it is needed
 

Users who are viewing this thread

Back
Top Bottom