Change field's default value for recordset

G

Guest

I have a field called “Markup†which exists in the table “ItemDetailâ€. The
default value is 1.25. Users access this and can make changes to it in a
subform called “BidLineItem subform2â€. They can either change the value in
each record in that subform, or change the value by using an update query
triggered from a command button in another subform, “Bid subformâ€.

I would like to enable users to enter a different value in a control on “Bid
subform†before they begin entering records in “BidLineItem subform2â€. That
value would then become the new default value only for the recordset they are
working in. This recordset is defined by a mainform control and another
control on “Bid subformâ€.

How do I go about accomplishing this?
Thank you in advance for any suggestions!
 
G

Guest

Kevin,

You can set the default for the *control* in “BidLineItem subform2†that is
bound to the field "Markup". This is temporary (unless you save the form);
when you close the form, the next time you open the form, the default value
will be the field default value (1.25).

The control default value property overrides the field default value. So if
you set a control default property to 2.35, add a few records then set the
control default to "" (or null), any new records entered till have the field
default property entered (1.25).

Add an unbound text box to enter the value and a button to update the
control default value property.

The code would look something like this:

Private Sub Command1_AfterUpdate()
Me.intMarkup.DefaultValue = Nz(Me.Text6, "")
End Sub


HTH
 

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