allow edits property of a form

A

Art Vandaley

Hi,

I have a form with "MSCAL.Calendar.7" control. I use it for filling some
textboxes showing days of related week. First group of textbox are unbounded
and for calculation something like following:

control source=Format([calendar2]-Weekday([calendar2];2)+1;"dd/mm";2)

Second group of textboxes are bounded to the related fields of a table and
gets their value from the first group. I have following code for filling the
textboxes:

Private Sub Calendar2_Click()
Text0.Value = Calendar2.Value
Text0.Format = "yyyy"
Text3.Value = Calendar2.Value
Text3.Format = "ww"
Text187.Value = Text5.Value
Text188.Value = Text7.Value
Text189.Value = Text9.Value
Text190.Value = Text11.Value
Text191.Value = Text13.Value
Text192.Value = Text15.Value
Text193.Value = Text17.Value
Combo44.SetFocus
Calendar2.Visible = False
End Sub

Now the problem:

Although, I selected "allow edits" property of the form as
"no", the old records are getting editable by clicking the Calendar 2
times???

I'll be very pleased to have an answer best regards.
 
V

Van T. Dinh

AFAIK, the AllowEdits = False only stops the user editing the data. In this
case, *your code*, *not* the user, modifies the data in the bound Controls
and hence the data in the Table when the updating action is done by the
Access Form.
 
A

Art Vandaley

Ok. Is there a way doing it by a code?

haber iletisinde said:
AFAIK, the AllowEdits = False only stops the user editing the data. In
this
case, *your code*, *not* the user, modifies the data in the bound Controls
and hence the data in the Table when the updating action is done by the
Access Form.

--
HTH
Van T. Dinh
MVP (Access)



Art Vandaley said:
Hi,

I have a form with "MSCAL.Calendar.7" control. I use it for filling some
textboxes showing days of related week. First group of textbox are unbounded
and for calculation something like following:

control source=Format([calendar2]-Weekday([calendar2];2)+1;"dd/mm";2)

Second group of textboxes are bounded to the related fields of a table
and
gets their value from the first group. I have following code for filling the
textboxes:

Private Sub Calendar2_Click()
Text0.Value = Calendar2.Value
Text0.Format = "yyyy"
Text3.Value = Calendar2.Value
Text3.Format = "ww"
Text187.Value = Text5.Value
Text188.Value = Text7.Value
Text189.Value = Text9.Value
Text190.Value = Text11.Value
Text191.Value = Text13.Value
Text192.Value = Text15.Value
Text193.Value = Text17.Value
Combo44.SetFocus
Calendar2.Visible = False
End Sub

Now the problem:

Although, I selected "allow edits" property of the form
as
"no", the old records are getting editable by clicking the Calendar 2
times???

I'll be very pleased to have an answer best regards.
 
V

Van T. Dinh

I am not sure what you are asking???

If you don't want the data to change, then don't write code that changes the
data???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top