J
javiernews via AccessMonster.com
Hi,
I need to change the value from a control property (Not the Form property).
For example I have to change the value of control property of the control
button on the event "On Click"
For Each objFrm In accAppNew.CurrentProject.AllForms
strDocForm = objFrm.Name
accAppNew.DoCmd.OpenForm strDocForm, acDesign, , , , acHidden
Set objFrm = accAppNew.Forms(strDocForm)
For Each objCtr In accAppNew.Forms(strDocForm).Controls
If objCtr.ControlType = acCommandButton Then
For Each objPrp In accAppNew.Forms(strDocForm).
Properties
If objPrp.Name = "OnClick" Then
If Len(objPrp.Value) > 0 Then
objPrp.Value = Replace(objPrp.Value,
"Search Value", "New Value") '<<<< IN THIS LINE IS THE PROBLEM
End If
End If
Next objPrp
End If
Next objCtr
accAppNew.DoCmd.Close acForm, strDocForm, acSaveYes
Next objFrm
I repeat I can change the Form property,........ but Not the Control property
of the command button
Any help will aprecite.
I need to change the value from a control property (Not the Form property).
For example I have to change the value of control property of the control
button on the event "On Click"
For Each objFrm In accAppNew.CurrentProject.AllForms
strDocForm = objFrm.Name
accAppNew.DoCmd.OpenForm strDocForm, acDesign, , , , acHidden
Set objFrm = accAppNew.Forms(strDocForm)
For Each objCtr In accAppNew.Forms(strDocForm).Controls
If objCtr.ControlType = acCommandButton Then
For Each objPrp In accAppNew.Forms(strDocForm).
Properties
If objPrp.Name = "OnClick" Then
If Len(objPrp.Value) > 0 Then
objPrp.Value = Replace(objPrp.Value,
"Search Value", "New Value") '<<<< IN THIS LINE IS THE PROBLEM
End If
End If
Next objPrp
End If
Next objCtr
accAppNew.DoCmd.Close acForm, strDocForm, acSaveYes
Next objFrm
I repeat I can change the Form property,........ but Not the Control property
of the command button
Any help will aprecite.