Prev: Jeanette, thank you for your help. I thought of doing it
Next: I didn't see your posts until just now. Not sure what
From: HubbyMax on 27 Jan 2010 16:36 I have a table that contains several fields but I am only concerned with two, OldPrice and NewPrice. On my form for entering new data both of these fields show. The custermer is charged using the average of these two fields. My problem is that when I enter a new NewPrice I need to have the OldPrice field update to the NewPrice before the change. EXAMPLE OldPrice $8.00 NewPrice $10.00 Price goes up to $12.00 and I enter it into the form Table should update to show OldPrice $10.00 NewPrice $12.00
From: Steve on 27 Jan 2010 16:55 Try putting the following code in the AfterUpdate event of NewPrice: Me!OldPrice = Me!NewPrice.OldValue Steve santus(a)penn.com "HubbyMax" <HubbyMax(a)discussions.microsoft.com> wrote in message news:07719CAF-35D8-42BB-8D4A-A89B1BB75859(a)microsoft.com... >I have a table that contains several fields but I am only concerned with >two, > OldPrice and NewPrice. On my form for entering new data both of these > fields > show. The custermer is charged using the average of these two fields. My > problem is that when I enter a new NewPrice I need to have the OldPrice > field > update to the NewPrice before the change. > > EXAMPLE > > OldPrice $8.00 NewPrice $10.00 > > Price goes up to $12.00 and I enter it into the form > > Table should update to show > > OldPrice $10.00 NewPrice $12.00
From: HubbyMax on 28 Jan 2010 14:58 I tried your suggestion but get an error stating "Can't find macro 'Me!OldPrice = Me!NewPrice' "Steve" wrote: > Try putting the following code in the AfterUpdate event of NewPrice: > > Me!OldPrice = Me!NewPrice.OldValue > > Steve > santus(a)penn.com > > > "HubbyMax" <HubbyMax(a)discussions.microsoft.com> wrote in message > news:07719CAF-35D8-42BB-8D4A-A89B1BB75859(a)microsoft.com... > >I have a table that contains several fields but I am only concerned with > >two, > > OldPrice and NewPrice. On my form for entering new data both of these > > fields > > show. The custermer is charged using the average of these two fields. My > > problem is that when I enter a new NewPrice I need to have the OldPrice > > field > > update to the NewPrice before the change. > > > > EXAMPLE > > > > OldPrice $8.00 NewPrice $10.00 > > > > Price goes up to $12.00 and I enter it into the form > > > > Table should update to show > > > > OldPrice $10.00 NewPrice $12.00 > > > . >
From: Steve on 28 Jan 2010 15:47 You need to put the code in the AfterUpdate event of the NewPrice field. Steve "HubbyMax" <HubbyMax(a)discussions.microsoft.com> wrote in message news:69105576-2C27-4B54-BD72-08C3B7047931(a)microsoft.com... >I tried your suggestion but get an error stating "Can't find macro > 'Me!OldPrice = Me!NewPrice' > > "Steve" wrote: > >> Try putting the following code in the AfterUpdate event of NewPrice: >> >> Me!OldPrice = Me!NewPrice.OldValue >> >> Steve >> santus(a)penn.com >> >> >> "HubbyMax" <HubbyMax(a)discussions.microsoft.com> wrote in message >> news:07719CAF-35D8-42BB-8D4A-A89B1BB75859(a)microsoft.com... >> >I have a table that contains several fields but I am only concerned with >> >two, >> > OldPrice and NewPrice. On my form for entering new data both of these >> > fields >> > show. The custermer is charged using the average of these two fields. >> > My >> > problem is that when I enter a new NewPrice I need to have the OldPrice >> > field >> > update to the NewPrice before the change. >> > >> > EXAMPLE >> > >> > OldPrice $8.00 NewPrice $10.00 >> > >> > Price goes up to $12.00 and I enter it into the form >> > >> > Table should update to show >> > >> > OldPrice $10.00 NewPrice $12.00 >> >> >> . >>
From: John Spencer on 28 Jan 2010 16:13
In other words, in design view == Click on the control == Select the Event tab of the properties == Enter [Event Procedure] or select it from the dropdown for After Update property == Click on the button at the end of the property box with three dots in it == Enter the suggested code between the lines Private Sub xxxxxxxx_AfterUpdate() Me!OldPrice = Me!NewPrice End Sub == Don't forget to use your control names. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Steve wrote: > You need to put the code in the AfterUpdate event of the NewPrice field. > > Steve > > > "HubbyMax" <HubbyMax(a)discussions.microsoft.com> wrote in message > news:69105576-2C27-4B54-BD72-08C3B7047931(a)microsoft.com... >> I tried your suggestion but get an error stating "Can't find macro >> 'Me!OldPrice = Me!NewPrice' >> >> "Steve" wrote: >> >>> Try putting the following code in the AfterUpdate event of NewPrice: >>> >>> Me!OldPrice = Me!NewPrice.OldValue >>> >>> Steve >>> santus(a)penn.com >>> >>> >>> "HubbyMax" <HubbyMax(a)discussions.microsoft.com> wrote in message >>> news:07719CAF-35D8-42BB-8D4A-A89B1BB75859(a)microsoft.com... >>>> I have a table that contains several fields but I am only concerned with >>>> two, >>>> OldPrice and NewPrice. On my form for entering new data both of these >>>> fields >>>> show. The custermer is charged using the average of these two fields. >>>> My >>>> problem is that when I enter a new NewPrice I need to have the OldPrice >>>> field >>>> update to the NewPrice before the change. >>>> >>>> EXAMPLE >>>> >>>> OldPrice $8.00 NewPrice $10.00 >>>> >>>> Price goes up to $12.00 and I enter it into the form >>>> >>>> Table should update to show >>>> >>>> OldPrice $10.00 NewPrice $12.00 >>> >>> . >>> > > |