Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a button that locks a field

Status
Not open for further replies.

jommyjet

Technical User
May 19, 2003
49
US
I have a button that locks a field ( in another form) selected from a combobox, but the design changes are not saved when I re-open the form where I lock a field. This seems simple, I must be missing a setting that allows editing changes. any ideas? thanks
could it be my form view?



If Me.lock.Value = "mar2002" Then
DoCmd.OpenForm "editmonthlyassignments2", acFormDS
Forms!editmonthlyassignments2![Mar2002].Locked = True
DoCmd.close acForm, "editmonthlyassignments2", acSaveYes
 
but the design changes are not saved when I re-open the form where I lock a field

Do you mean that you press the button which opens the form and the required locked field is not locked?

If so, then pass the name of the field to be locked in the openargs of the form
Code:
DoCmd.OpenForm "editmonthlyassignments2", , , , , , (fieldtolock)

then on the open event for the editmonthlyassignments2 form

Code:
dim ctrl as control

If not isnull(me.openargs)then
     set ctrl = me!(openargs)
     with ctrl
     .locked =true
     end with
end if




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top