Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2006

Tip: Looking for answers? Try searching our database.

Change field's default value for recordset

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin - 06 Apr 2006 19:58 GMT
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!
SteveS - 09 Apr 2006 03:03 GMT
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
Signature

Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)

> 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
[quoted text clipped - 10 lines]
> How do I go about accomplishing this?
> Thank you in advance for any suggestions!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.