N
naigy
Hi All,
uI have written a quote routine that is working well with taking the details
from a form and exporting to word in the correct positions. I have one
problem where the item attracts GST (all have a part group code of SPVC). In
the database it is not important to log GST amounts etc but when generating a
quote for a customer it needs to be on the form which I really need in word
format unfortunately (not a report).
I have written the following routine which works for the most part but has
the problem that it doesn't just keep two decimal spaces (for cents). GST for
me is 10%.
Example of this problem is say the item price is $2.47 it will output $2.717.
In reality I want this to come out as $2.72 as it should round to the closest
full cent.
If rs.Fields("PartGroupCode") = "SPVC" Then
'Add comment to partdesc "inc GST"
If rs.Fields("Quantity") = 1 Then
oTable.Cell(Position, 2).Range.Text = rs.Fields
("PartDesc") & " inc GST"
oTable.Cell(Position, 3).Range.Text = "$" & rs.Fields
("Sale_Cost") * 1.1
Else
oTable.Cell(Position, 2).Range.Text = rs.Fields
("PartDesc") & " x " & rs.Fields("Quantity") & " @ $" & rs.Fields
("SalesPrice") * 1.1 & " ea inc GST"
oTable.Cell(Position, 3).Range.Text = "$" & rs.Fields
("Sale_Cost") * 1.1
Also need the exported value to have .00 if it is a full dollar amount (ie
$110.00 instead of $110)
I figure I need something similar to a right or left function which
references the decimal point but also need something to take into account the
roundings and the full dollar amount scenarios.
I have searched for terms that I thought may contain this information but had
no success but if there is something already if someone could point me to the
appropriate topic. Any assistance is appreciated.
uI have written a quote routine that is working well with taking the details
from a form and exporting to word in the correct positions. I have one
problem where the item attracts GST (all have a part group code of SPVC). In
the database it is not important to log GST amounts etc but when generating a
quote for a customer it needs to be on the form which I really need in word
format unfortunately (not a report).
I have written the following routine which works for the most part but has
the problem that it doesn't just keep two decimal spaces (for cents). GST for
me is 10%.
Example of this problem is say the item price is $2.47 it will output $2.717.
In reality I want this to come out as $2.72 as it should round to the closest
full cent.
If rs.Fields("PartGroupCode") = "SPVC" Then
'Add comment to partdesc "inc GST"
If rs.Fields("Quantity") = 1 Then
oTable.Cell(Position, 2).Range.Text = rs.Fields
("PartDesc") & " inc GST"
oTable.Cell(Position, 3).Range.Text = "$" & rs.Fields
("Sale_Cost") * 1.1
Else
oTable.Cell(Position, 2).Range.Text = rs.Fields
("PartDesc") & " x " & rs.Fields("Quantity") & " @ $" & rs.Fields
("SalesPrice") * 1.1 & " ea inc GST"
oTable.Cell(Position, 3).Range.Text = "$" & rs.Fields
("Sale_Cost") * 1.1
Also need the exported value to have .00 if it is a full dollar amount (ie
$110.00 instead of $110)
I figure I need something similar to a right or left function which
references the decimal point but also need something to take into account the
roundings and the full dollar amount scenarios.
I have searched for terms that I thought may contain this information but had
no success but if there is something already if someone could point me to the
appropriate topic. Any assistance is appreciated.