allowAdditions problem

ylp

Registered User.
Local time
Today, 05:08
Joined
Mar 25, 2010
Messages
42
Hi,
This might be a dummy question:

I have a continuous form with a DatetimePicker, textboxes,which displays one month's data, but always got one more empty row at the end of each month, after set AllowAdditions to No for the form, got an error:

Run-time error 2763, DTPicker returned the error: property is read-only.

And no data displayed at all on the form.

Any help appreciated!
 
Last edited:
Sounds like there's some piece of code that you've written that's trying to set the value of one of the DateTime picker control's property.

Also, does the control have a control source set?
 
HI,

Thanks so much for your reply!!

There is no Control Source for the DatetimePicker, I read date time from it.

Thanks again.
 
Do you have any code (anywhere on the form module) that sets a property of the Date Picker control?
 
Yes,

If user clicks a button, I set its value to the former month:

Me.DTP.Value=DateAdd("m", -1, Me.DTP)
 
I'm thinking that code runs after you've set the form's AllowAdditions to False. Check the flow of code.
 
Thanks very much for your help!

Actually, I have this code in Form_load()
Me.DTP.Value=Now()

When I run to this line of code, the error shows.
 
I would love to, but it is too big.

This code(Me.DTP.Value=Now()) is the first code when I test,what is the possible problem?

Sorry about that and thanks for your great help.
 
One line of code like that wouldn't cause the problem. Let's see your whole code. The On Load event and also the button you click to NOT ALLOW ADDITIONS.
 
Hi, thanks so much!

The problem is solved.

Add Form_beforeInsert event
Cancel=true

This will not allow user to enter data in the additional row.

Thanks and have a nice day!
 

Users who are viewing this thread

Back
Top Bottom