Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carrying field value from one record to the next 1

Status
Not open for further replies.

THWatson

Technical User
Apr 25, 2000
2,601
CA
Using Access 2007

In an electrician's database, there is frmCustomers. One of the tabs on that form is for Projects: this is where the user enters Materials and Labour for that Project. So there are 2 subforms, fsubMaterials and fsubLabour.

I am concerned with fsubMaterials - displayed as a continuous form. One of the controls is Markup, which is the % that materials are marked up from the cost of the supplier. This in the greatest majority of cases is 20%, and that is the default set in tblMaterials, but the user wishes to be able to change that amount to anywhere from 0% up.

Since there could be quite a number of Materials items, I would like the user to only have to enter the Markup value once, and this would carry for all the Materials entered on that particular Project.

Currently, if the user wishes a Markup other than 20%, he has to enter the desired Markup in that field for each Material, as the automatic default of 20% continues to recur.

I tried moving the Markup into the subform's header, but that didn't work.

Is there a way to fix this so the user has to enter that Markup only once and it will then carry for all the Materials on that project?

Thanks.

Tom
 
Move it to the main form(tab)? write the value to the materials table?
maybe even prompt on the first entry for a markup with an afterupdate event storing the value in a constant to write to the table?

thoughts?

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Thanks, MazeWorX
I assume that when you say a tab on the "main form, you mean a tab on fsubProjects. Because fsubMaterials is a subform of fsubProjects.

I'll have a look at that and report back.

Tom
 
Howdy THWatson ... long time no hear!

In the [blue]AfterUpdate[/blue] event of [blue]MarkUp[/blue], why not simply:
Code:
[blue]   Me.MarkUp.DefaultValue = """" & Me.MarkUp & """"[/blue]
[blue]Your Thoughts? . . .[/blue]


See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Hello right back, TheAceMan1. Great to hear from you!

Your solution works like a charm.

Markup is the name of the field in the table. On the form I call it txtMarkup. So just change that and the solution becomes:
Code:
Me.txtMarkup.DefaultValue = """" & Me.txtMarkup & """"

Thanks.

I trust all things are well with you. This past year has been complicated by my wife having some cancer issues and surgeries but, hopefully, that is behind us now!

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top