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 / July 2007

Tip: Looking for answers? Try searching our database.

After Update

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
stephendeloach - 06 Jul 2007 20:09 GMT
In my form i have a subform, In the subform I have a check box that when
checked needs to multiply the UnitPrice by Expendable and when unchecked the
UnitPrice needs to return to original price. As of now this is the
AfterUpdate command..

Private Sub Expendable_AfterUpdate()

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0) * 1.1
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0) / 1.1

End If
End Sub

I need to change it because sometimes the expandable will be more than 10%. I
have added an Expendables field in the main form (Table1). I would think this
would be what I am looking for but i really dont have a clue what I am doing!.
..

Private Sub Expendable_AfterUpdate()

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0) * [Expendable]
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0) / [Expendable]

End If
End Sub

am i close??
stephendeloach - 06 Jul 2007 21:20 GMT
After playing around with it I have added the exp field to the subform. This
is where I enter the percentage. Then in the after update of the of the
Expendable field i have this..

Private Sub Expendable_AfterUpdate()

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0) * [exp]
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0) / [exp]

End If
End Sub

which gives me the precentage of the unitprice.. but I need the precentage of
the unitprice to be ADDED to the unitprice... how would i do this?

>In my form i have a subform, In the subform I have a check box that when
>checked needs to multiply the UnitPrice by Expendable and when unchecked the
[quoted text clipped - 27 lines]
>
>am i close??
Bob Quintal - 06 Jul 2007 21:14 GMT
> After playing around with it I have added the exp field to the
> subform. This is where I enter the percentage. Then in the
[quoted text clipped - 13 lines]
> the precentage of the unitprice to be ADDED to the
> unitprice... how would i do this?

If Me!Expendable = True Then
Me!UnitPrice = Nz(Me!UnitPrice, 0)+ Nz(Me!UnitPrice, 0) * [exp]  
Else
Me!UnitPrice = Nz(Me!UnitPrice, 0)- Nz(Me!UnitPrice, 0) / [exp]
End if

Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

 
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



©2009 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.