My plan is to expose only certain fields to the end user of an mde for setting default values (no design views allowed)at the form level.
Textboxes in the form to be used to set defaultvalue in the target form have their own defaultvalue set to the defaultvalue of the target form with an expression:
=[Forms]![frmTarget_Form]![misc].[DefaultValue]
that works.
Each of the textboxes in the form used to set defaultvalues has a routine on the afterupdate event:
Private Sub misc_AfterUpdate()
Call StageNDarray("misc", CStr(misc.Value))
End Sub
StageNDarray builds a two dimensional array, the fields and values of the textboxes.
When the button is clicked, the new defaultvalue properties appear in the target form's field property settings exactly right,
(one lines wraps in paste below)
For ndv = 0 To UBound(NewDefaults, 1)
If NewDefaults(ndv, 0) <> "" Then
Forms!sbfFee_Schedule.Controls(NewDefaults(ndv, 0)).DefaultValue = NewDefaults(ndv, 1)
End If
Next ndv
except they don't get saved !!!
It is blowing my mind because they did save the first time the routine worked. Now when I close the target form, it's all undone, with the default values from the first time it worked there to haunt me.
The target form's defaultvalue properties were null for all fields before the first time the routine worked.
Anyone ever try this, or something like it?
Thanks
Textboxes in the form to be used to set defaultvalue in the target form have their own defaultvalue set to the defaultvalue of the target form with an expression:
=[Forms]![frmTarget_Form]![misc].[DefaultValue]
that works.
Each of the textboxes in the form used to set defaultvalues has a routine on the afterupdate event:
Private Sub misc_AfterUpdate()
Call StageNDarray("misc", CStr(misc.Value))
End Sub
StageNDarray builds a two dimensional array, the fields and values of the textboxes.
When the button is clicked, the new defaultvalue properties appear in the target form's field property settings exactly right,
(one lines wraps in paste below)
For ndv = 0 To UBound(NewDefaults, 1)
If NewDefaults(ndv, 0) <> "" Then
Forms!sbfFee_Schedule.Controls(NewDefaults(ndv, 0)).DefaultValue = NewDefaults(ndv, 1)
End If
Next ndv
except they don't get saved !!!
It is blowing my mind because they did save the first time the routine worked. Now when I close the target form, it's all undone, with the default values from the first time it worked there to haunt me.
The target form's defaultvalue properties were null for all fields before the first time the routine worked.
Anyone ever try this, or something like it?
Thanks