Case statement for unbound textbox

I am creating an invoice where each product is totaled in an unbound
textbox call [LineTotal]. Here is the complicate part. The total is
based on certain conditions. I was able to do it just fine on the
form, but am having a hard time getting it to do it in the report.

First, if there is a discount I have to take that into effect. Second,
if there are multiple copies I give a 50% discount unless the hours
are 15 min (always $2.50) or 1 hour (always $10).

Anyone know what I should do??

Thanks,  KS


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If PrintCount = 0 Then
    cost = ([Hours] * [UnitPrice])

If [Discount] > 0 Then
    DiscPrice = ([Hours] * [UnitPrice]) * [Discount]
    Price = cost - DiscPrice
Else
    Price = ([Hours] * [UnitPrice])
End If

If [Quantity] > 1 Then
Select Case linetotal
 Case 0.25
    Me![linetotal]= cost * [Quantity]
 Case 0.5 To 1
    extra = (cost * ([Quantity] - 1)) / 2
    Me![linetotal] = extra + cost
 Case Is > 1
Me![linetotal] = cost + ([Quantity] * 10)
End Select
End If

End If

End Sub
0
tripscott
12/15/2007 7:27:41 PM
access.reports 4434 articles. 0 followers. Follow

1 Replies
1110 Views

Similar Articles

[PageSpeed] 7

Nevermind. I figured it out.
0
tripscott
12/15/2007 9:18:43 PM
Reply:

Similar Artilces:

IF statement
Need help with an IF statement. If cell B25 has either 25 or -25, I need cell d7 to return the value of 3 Thank You James, In D7..... =IF(ABS(B25)=25,3,"") John "James Beam" <jimbeam27@earthlink.net> wrote in message news:lShVb.15586$F23.13831@newsread2.news.pas.earthlink.net... > Need help with an IF statement. > > If cell B25 has either 25 or -25, I need cell d7 to return the value of 3 > > > > Thank You > > Try this in D7: =3*(MOD(B25,25)=0) -- HTH, RD ------------------------------------------------------------------...

Excel if statement help
I have a valid, working excel formula that states: =IF(BL17>=1,1,0) However, I need it to say If bl17 (or bl19) are greater or equal to 1, than 1, else 0 The or bl19 is really the only new part. How can I add that in with correct syntax ? Just look in the help index for OR -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com <cegarbage@gmail.com> wrote in message news:df47d203-0fc7-4b73-ae96-662b900f835b@x41g2000hsb.googlegroups.com... >I have a valid, working excel formula that states: > > =IF(BL17>=1,1,0) > > However, I need it to ...

If Statement that Copies to another Sheet
I am not sure how to create an IF statement that does the following: If a cell is >1 then copy the contents of another cell onto another sheet. Can this be done? And does this make sense Thank you for your help!! :confused: --- Message posted from http://www.ExcelForum.com/ It can't be done - worksheet functions can only return values to their calling cells. However, you can put this in the cell in your second sheet: J1: =IF(Sheet1!A1>1, Sheet1!B1, "") which will display the contents of Sheet1!B1 if Sheet1A1 > 1, else will display a null string. In...

Textbox fields on continuous forms
How can you have different coloured text in a text box of a continuous form. For example I would like the text to be red if the value is 25% or greater all other value should have black text. The data type is percent with 1 decimal point. Assuming you're working with Access 2000 or later, select the field, goto Format > Conditional Format and set your condition and text format preference. Adgiles wrote: >How can you have different coloured text in a text box of a continuous form. >For example I would like the text to be red if the value is 25% or greater >all other valu...

the address returned from "new" statement is 4-byte aligned?
Hi i'm using intel P4. when I write the statement like char *p=new char[512] what's the p value, is it aligned by 4 bytes? that's is p%4==0? and, now I'm using the Intel SSE2 instruction to do some fast algorthm, some instructions I need to move data from memory to XMM0 registers(which is 128 bits) should be be aligned on 16-byte boundaries. so, how can use these Instructions when I should take some operations on data just "new" on the heap. Is there any suggestions to solve this problems? thanks It is likely; in fact, it is probably true that p%8==0. But tha...

IF statement question
Is it possible to test for more than 2 different conditions? ...example total number of hours paid hours 5 hrs 5 hrs 10 hrs 9.5 hrs 12 hrs 10 mins 12 hrs IF "total number of hours" <6 this will be "paid hours" ..... IF "total number of hours" >6 but <12 "paid hours" = "total number of hours" -.5 IF "total number of hours" >12 "paid hours" = "total number of hours" -.1 -----= Poste...

IF statement help please
I have data in the following form and I need a formula to produce the contents of the Formula result column. Invoice Product Value Formula result 1 car 10 No bus on invoice 1 car 10 No bus on invoice 1 bike 5 No bus on invoice 1 boat 15 No bus on invoice 1 train 50 No bus on invoice 2 bike 5 No bus on invoice 2 bike 5 No bus on invoice 2 boat 15 No bus on invoice 2 train 50 No bus on invoice 2 train 50 No bus on invoice 2 car 10 No bus on invoice 3 car 10 Bus on invoice 3 bus 25 Bus on invoice 3 tractor 20 Bus on invoice Your help would be very much appreciated. try som...

If Statements...
I have this if statement: =if(sum(e6=20040101:20040331),"1",if(sum(e6=20040401:20040630),"2",if(sum(e6=20040701:20040930),"3",if(sum(e6=20041001:20041231),"4","not this year")))) I am not quite a beginner, but I'm not an expert either. You can probably guess what I am trying to do..but if not, here's what I'm trying to accomplish. If the sum of e6 equals any number from 20040101 to 20040331 then produce a 1 in the cell, if not, blah blah..you get it. What am I missing? Thanks! -- Delaina -----------------------------------...

Adding a page to a MS statement
Hello I have downloaded a statement from microsofts website. It is one page. I added on another page; however, it shows on the computer monitor but won't print the 2nd page. I am sure there is a simple setting I am not seeing. Can anyone help? ...

Unbound Calculation populates from 3 seperate fields
Hope someone can help me solve this...I really need some help, I have tried and read alot and can not find the answer I am looking for. I am trying to get this expression to work in my database. I have 3 fields QC%, InBound% and 3rd Party% that have percentages. using a bound field: ( I have used IIF and NZ to assist with Null values) QC%=IIf(nz([SumOfQC Total Number Audited],'0')=0,0,Sum(nz([SumOfQC Passed Audits],'0'))/Sum(nz([SumOfQC Total Number Audited],'0'))*100 InBound%=IIf(nz([SumOfInBound Total],'0')=0,0,Sum(nz([SumOfInBound Passed Audits...

TextBox
I need a TextBox to have a formula to bring in a date, i.e. A1=38141, formated to Jun-04. How do I get A1 into a TextBox as Jun-04? Any help is very much appreciated. Hi, Use =TEXT(A12,"mmm-dd") in A1; and A1 as your linked cell? jeff >-----Original Message----- >I need a TextBox to have a formula to bring in a date, >i.e. A1=38141, formated to Jun-04. How do I get A1 into >a TextBox as Jun-04? > >Any help is very much appreciated. >. > ...

How to change sentence in Caps to upper & lower case
In Microst Word XP, How can I change a sentence which is in all capitals to one that is in upper and lower case without having to retype it all? Shift+F3 -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Tallymej" <Tallymej@discussions.microsoft.com> wrote in message news:94CDC803-D844-4D49-87D6-B6381129D71B@microsoft.com... > In Microst Word XP, How can I change a sentence which is in all capitals > to > one that is in upper and lower case without having to retype it all? Format |...

how to make that the subform can grow without running over the textboxes at the bottom of the mainform.
Hi I have mainform that contains textboxes then subform datasheet beneath and after that there is a textboxes again. The problem is when the mainform grows it runs over the textboxes that at the button of the main form. I need to know how to make that the subform can grow without running over the textboxes at the bottom of the mainform. Thanks Set the Can Grow attribute for the detail section, assuming that's where the various controls are located. HTH -- -Larry- -- "Chipcom" <bz1977@gmail.com> wrote in message news:1191388299.890979.46580@d55g2000hsg.googlegroups.co...

Linking cases to Leads?
Hello, Does anyone know if it's possible to link a case to a Lead in CRM 3.0? When we create a support case and look up the 'Customer' field, we can only select an 'Account' or 'Contact'. Is it possible to include 'Lead' in this look-up? Many thanks for your help. Sinead. -- Sinead O''''Shaughnessy Sinead, It's not possible to do it. All customer fields in CRM can only be linked to accounts or contacts. In CRM's philosophy a lead is an unqualified contact and therefore cannot create a new case. This may not always be true, bu...

Who is the recipient for Case Email Templates?
Hi If we use the email template to send an email in a Workflow Rule for a case, who's the recipient for the email? I understand we cannot select the recipient when an email template is used in a workflow but does it send to the email addr in the Account Email field or to the email address of the Primary Contact for the Account? My testing seems to say it sent to the Primary Contact. Is there any way to make it send to the email address in the Account record? Thnks, Jeffrey Au CORCEL SYSTEMS SDN BHD, www.corcelsystems.com We design and develop business-led database-driven web applica...

creating relationship between entity case and entity quote.
Hi everybody I am trying to create a relationship between entity case and entity quote. But I cannot able to do it. Is it Possible anyway. Regards Thanks in advance. -- Jaber You can't do this, unfortunately; CRM does not allow you to create new relationships between system entities. It depends on your data model, but one option might be to create a custom entity that has a relationship to both the case and the quote -- David Jennaway - Microsoft Dynamics CRM MVP Web: http://www.excitation.co.uk "Jaber" wrote: > Hi everybody > I am trying to create a relationship ...

Generating consecutive file names when printing statements to PDF
Hi I was wondering if some one could help me with this. We have been using RMS 1.3 r1 and latest hotfix for 1 year now. When we close our monthly billing period using Close Billing Cycle we print statements using the Adobe PDF Printer 7.0 which generates PDF files so that we can email them to the clients. Currently we have to name each and every file during the PDF generation process with a unique name so that it doesn't overwrite the one printed before.... with 200 - 300 statements this can get tedious. IS there a way to make it automatically generate consecutive names: document ...

How do I change Letter case (lower to Upper) in a spreadsheet???
Please Help.... I cannot figure out how to change the text from lower to upper case. I have tried working with the formula suggested by MS but I cannot get it to work. I am sure I am missing something simple, any help is appreciated. Thanks. the formula would refer to another cell not the one you are in =upper(a1) to change the cell you are in you need a macro. Maybe this will help. Sub ChangeCase() 'Don Guillett Application.ScreenUpdating = False Dim r As Range nCase = UCase(InputBox("Enter U for UPPER" & Chr$(13) & " L for lower" & Chr$(13) &...

If Statements- New User
Good Afternoon, Could someone please be of assistance. I am currently a new user and I am having difficulty with "IF" statements. I am working on a spread sheet that has various departments: Art, Design, Liberal Studies, ect. I want to creat a statement that has the following: If 1000 then it should read faculty of Art If 1300 then it should read faculty of Design If 1700 then it should read liberal studies etc. I keep trying to do this but if keeps giving me error messages. I'm hoping someone can help. If statements can't be that complicated. Are they? Many Thanks Mo...

Billing from time spent on cases
I am really in need of a add-on piece to CRM that would allow our company (and our clients, for that matter) to bill based on time spent on a particular case. Specifically, I'm looking for Technical Support-based time billing and Legal time billing. We're looking for CRM to automatically compile hours for a given customer and then, after progressing through a billable time review process, generate invoices. I think I've heard that that functionality was originally going to be handled by Great Plains, but many of our small clients are looking for CRM and the capabilities m...

Convert a textbox string value into date
I need to convert a textbox string value in the form of 31-12-09 into a date in the same format, can any one help please, thank you. >>I need to convert a textbox string value in the form of 31-12-09 into a date in the same format, Converting I understand but 'into a date in the same format' is confusing. DateSerial("20" & Right("31-12-09",2),Mid("31-12-09",InStr("31-12-09","-")+1,2),Left("31-12-09",2)) If you format it for display the results is a string. If you are going to use it in calculati...

making textbox to be auto sizable in Word 2007
I added a Textbox to a Word 2007 document by going to the Developer option(in the File menu), then chose Design Mode, then Legacy Tools->Text box Field. The MultiLine and Enterkey properties are set to True and the rest are default. The textbox is of size so that it can take some 10 rows of lines. Is there a feature I can choose/set so that when more than 10 rows of lines are entered the text box will automatically expand? The rows need to increase so the textbox needs to expand downwards to accommodate the text more than 10 lines. Can someone please advise if there is a way to do...

Workflow when case is resolved (CRM 4.0)
Hi! I have created a datetime field on the case form which I want to set using a workflow when a case is resolved (meaning when the user clicks actions, resolve case). I can't find any triggers on this in the workflow creation prosess, any ideas or help to get me started? Greatly appreciated, thanks! Hello there! On your workflow form, you need to click the "Record Status changes" check box in the "Start When:" section. This will cause a workflow instance to be created everytime the status of the case changes. You then add a condition in your workflow which chec...

sorting data in a textbox control
hello everyone, could you please tell me how, or if it is possible, to sort data in a txt box. I am using this textbox on a report and have concatenated group totals in the textbox. I need to find the Median of the list and in order to do this, the list, in the textbox needs to be sorted. -- phm You need to clarify. I have not heard of a text box containing a list. Typically users want to sort the records in a report. I can't make any sense of your question or what a typical value in the text box might look like. How does the "list" get into a text box? ...

Need to Change Case from Mixed to Caps
Please help! I have a number of imported worksheets with some fields formatted in mixed case and some in UPPER case. I want all data to look consistent. Is there a way that I can quickly turn all of the mixed case to upper case? Word has a button to do this but I don't see one in Excel. Thanks in advance. Hi, have a look at the UPPER function in XLHelp -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Kathy" wrote: > Please ...