Search results

  1. WineSnob

    Loop Thru Table and ADD field values?

    I did copy/paste. All the field names look correct. I really struggle with SQL statements and the " and & and " syntax. I tried to deleting the ; at the end after the Order By tblIncomeTemp.Yr;" No luck. Do I need the replace the With rs .MoveFirst to read While not rs.EOF Wend This rs...
  2. WineSnob

    Loop Thru Table and ADD field values?

    I get an error "Too few parameters. Expected 1."
  3. WineSnob

    Loop Thru Table and ADD field values?

    Beetle's code worked fine UNTIL I added a start year and end year as arguments. Now I want to sum in blocks of years 1-5 or 4-6 or 6-11. Here is the modified code. Now I think it is the .MoveFirst giving me the problem. How do I use the nStartYear and nEndYear as the range? Function...
  4. WineSnob

    Loop Thru Table and ADD field values?

    Perfect! Thanks
  5. WineSnob

    Loop Thru Table and ADD field values?

    No I am getting the Last [Desired Income] Value in the table. I assume it is the .EOF. I only want to add the [Desired Income] for Yr 1 to nYears (5) Here are the values in the table. Yr Desired Income 1 5000 2 5050 3 5100.50 4 5151.51 5 5203.02 6 5255.05 Therefore if I am sending 5 as nYears...
  6. WineSnob

    Loop Thru Table and ADD field values?

    I have a table called [tblIncomeTemp] with fields [Yr](1,2,3,.....) and [Desired Income] and [ProposalID]. I am TRYING to loop through the table and add up the [Desired Income] for a specified number of Years. Not sure how to do that though. Below is what I am trying to use. Something is wrong...
  7. WineSnob

    Days left in the year from a date

    Got it. I love to learn something new. Makes me feel like a new baby. Very much Appreciated. Thanks again Paul MVP Lifetime!!!
  8. WineSnob

    Days left in the year from a date

    So I can LEARN something new what is the correct syntax for ?DateDiff("d",Date(),DateSerial(Year(Date()),12,31 )) Do i put it in a module as a sub or directly in the immediate window?
  9. WineSnob

    Days left in the year from a date

    Thanks to Paul and Sean. I used Pauls solution with date serial because I have never seen code with the ? mark in front and dont know how to use it. Thanks to both.
  10. WineSnob

    Days left in the year from a date

    I guess that is what I am struggling on how to do that. Can you guide me as to how to do it? Thanks Paul !
  11. WineSnob

    Days left in the year from a date

    Here is the entire code. It works the way it is but requires the user to input 12/31 of the year in [argdate]. Note the comment in the code where I want to eliminate the user having to input the last day of the year in the form textbox [argenddate]. I thought is would easy to get the number of...
  12. WineSnob

    Days left in the year from a date

    Clarification: I want the code to read: For nStartDate = (Forms![Annual Vendor Budget Input]![argdate]) To (Forms![Annual Vendor Budget Input]![argdate]) + nDaysLeft With (Forms![Annual Vendor Budget Input]![argdate]) as the only input date.
  13. WineSnob

    Days left in the year from a date

    The Year(StartDate) gives me 2013. I am trying to get 266 from the date $/9/2012. Currently I am using the following but want to change it so the user only has to enter one date value. For nStartDate = (Forms![Annual Vendor Budget Input]![argdate]) To (Forms![Annual Vendor Budget...
  14. WineSnob

    Days left in the year from a date

    I have a control on a form that the user will input a date. I need to know how many days are left in the year to use that number as variable in my code. So far I found things about DateDiff but I only have the start date not the end date. Which would be StartDate + # of days left in the year...
  15. WineSnob

    Get first Day of each month

    Thanks Plog ! That did it.
  16. WineSnob

    End of Month, Begin of Month

    Take a look at this: http://msdn.microsoft.com/en-us/library/aa227522(v=vs.60).aspx
  17. WineSnob

    Get first Day of each month

    I am trying to get the first day of each month using a date as the argument. Here is the code I am trying to get work . It is CLOSE except for the month of February returns 1/1/2013 from 2/2/2013. The other months are OK. See the resultls below the code. What am I missing to get February to...
  18. WineSnob

    If in a loop ?

    Thanks...I'll try that
  19. WineSnob

    If in a loop ?

    Years 1,2,3,4,5 the calculation will be If nInflYear = 5 Then StartIncomeAmt = ClientMonthlyInc at year 6 calculation will be StartIncomeAmt = ClientMonthlyInc * (1 + InflationFactor) ^ ( 6 - 1) When I loop and get to year 6 the calculation will change How do I count the loops and at year 6...
  20. WineSnob

    checkbox

    Try this: If Forms!tblpool!chkdefine.Value = True Then Forms!tblpool!definedate = definedate.Value Else Forms!tblpool!definedate = Date End If
Back
Top Bottom