in an actual project i created a generic form for table editing (see attached pic). It loads the table given as FormOpenArg into a SubForm. Additionally default filters (here Statement and SAccount) can be set. In case the filter is a drop down list (not a like filter) the filtered fields are hidden from the UI. If such a filter is set i have to preset the field with the filtered value when creating a new record. Setting the default value of the TableDef doesn't seem to work as it doesn't apply to the open instance in the form. Neither does setting the default value of the field in the SubForm work properly.
not sure if you are doing this via a macro or code. I see that you are also using a datasheet view as the form design. If you used a regular form with textboxes and the like, you could write code to preset the value or set the default value. In code, you could do something like this
Private Sub Text00_BeforeUpdate(Cancel As Integer)
If rs.field = value1 then
me.text.00.text = something
elseif rs.field = value2 then
me.text00.text= something else
me.text00.text = something else
hope this helps. sorry, I am only able to spend a couple of minutes on this.
the form is intended to be a generic edit form. the table displayed is defined by a parameter. it's to avoid a edit form for each and every table (works fine so far). btw - everythin is done in code not via macro. the only thing missing is the default value for the hidden fields (defined by the dropdown filters in the header).
ok then I would recommend what I posted last time. set the following based upon the selection: me.text1.defaultvalue = "somevalue" or me.text1.text = "somevalue" in the afterupdate event of the combofilter.
instead of using an unbound form .. both forms (container and subform) have the same table as source. the outer form is filtered and the subform is bound to the outer one - and the defaults are set automatically by access.