Search results

  1. Elephant

    Can anyone see the problem with this code?

    I am developing a database for a travel company. Attached is a small test part of that database where I am trying to input dates of hotel stay in a form and have price of stay automatically calculated. For some reason the code used in the Form "Hotels Frm" does not work and I get a syntax...
  2. Elephant

    Calculating prices over a date range

    Thanks Tay for your reply. If I made a table with a date for each day of the year (ie 365 days) and next to it a price for that day, what formula could I use to show the total price for any given period eg, I would have a Order Details sub-form with Hotel name, arrival date, deaprture date...
  3. Elephant

    Calculating prices over a date range

    Thanks Col for the reply. Most hotels I am using have 2 prices, a High Season and a Low Season. Some Tuesdays could be Low season and some Tuesdays could be High Season. Can Access take into account days through the whole year, rather than a week? I have the prices stored in a "Hotel...
  4. Elephant

    Price calculations between dates

    Hi Shay, I put up a new thread. I started by asking my original question again, mainly becuase I am not sure of the technicalities behind what the date thing you were trying to solve ... maybe you could ask that as a seperate thread, and one way or the other we will get there. Thanks for all...
  5. Elephant

    Calculating prices over a date range

    I am developing a database for a travel company. I have a form called "Orders" with general details about customer and a "OrderID". A sub-form to this is "Order Details" listing the various itmes of the order, ie hotel stays. In the "Order Details" sub-form I want to put the Supplier name...
  6. Elephant

    Price calculations between dates

    Thanks Shay for all your help on this ... Will start a new thread and see what comes back ... I am not sure if to start with my original question, or the technical issue re the dates ... Am I right that this whole thing can't be done using a formula rather than code? Steve
  7. Elephant

    Price calculations between dates

    Now I don't get the error! I get a value in the total cost box!! Initial look though, the value isn't correct when a stay is over 2 price bands ... do you still need to adjust the date code or ...? THANKS for your patience and effort !!! :)
  8. Elephant

    Price calculations between dates

    MySQL = "([RoomType]='Double') and ([HotelID]=1) and (#09.23.03# Between [SeasonStartDate] And [SeasonEndDate]) This what you needed?
  9. Elephant

    Price calculations between dates

    You mean like this ? --- Public Function DaysPrice(ThisDate As String) Dim MySQL As String 'This functions looks up the price for this hotel, room type and date. MySQL = "([RoomType] = '" & Me.cmbRoomType & "') and " & _ "([HotelID] = " & Me.cmbHotelName & ") and...
  10. Elephant

    Price calculations between dates

    It does jump there as you. DaysPrice = Empty
  11. Elephant

    Price calculations between dates

    Thanks for your patience! It does get to TotalCost = TotalCost + DaysPrice(ThisDate), yes, but the TotalCost is always 0. I put in variuous dates such as March, June and September 2003.
  12. Elephant

    Price calculations between dates

    I tried the f8 and same happened as previous. ie, When I got the error I pressed "Debug" and got this Visual Basic code - yellow arrow on the left by "Total Cost ..." ... and on pressing f8 it moves through the code highlighting parts in yellow until on pressing F8 at "End Function" Ln 35...
  13. Elephant

    Price calculations between dates

    I've no idea! How can I find out ? - sorry, I have zero knowledge of this code ...
  14. Elephant

    Price calculations between dates

    Hopefully I have all the possible variables here : Where TotalCost is always TotalCost=0 Over the ThisDate and EndDate it shows correct dates over "i" shows i=0 Nothing shows over "DaysPrice" - should it? Me.txtTotalCost it shows Me.txtTotalCost=Null Does that help?
  15. Elephant

    Price calculations between dates

    Hi Shay, Added the extra line of code, but got same result when testing the form ... I'm not really sure what to look for when putting the cursor over the variables ... I can't figure out, either, why it would the form would work fine on your computer but not on mine ... Not sure what to do...
  16. Elephant

    Price calculations between dates

    Morning Shay, I tried a new button and a database repair - same errors come up. Further to something you mentioned Wednesday : "I presume you've checked that it's calculating DaysPrice correctly. " --- not sure actually how to do this - I don't see any calculations on the form itself so assume...
  17. Elephant

    Price calculations between dates

    Hello Shay, Thanks for all your help on Wednesday. I didn't get any replies from anyone else so ... I was wondering if perhaps I could have go at making the control button myself, if you could advise me? I have very limited knowledge of VB .... Or, is there a way to get the same result by...
  18. Elephant

    Attached file below not working - why?

    In the message posted below "Price calculations between dates", Shay has kindly made a sample database which seems to solve my problem. however, on runnig a command button I get error messages. Shay made the database in Access 97 using Windows 95. I'm using Acess 2002 on XP ---------- could...
  19. Elephant

    Price calculations between dates

    Hi Shay, I followed your instructions and on pressing F8 the point where it gives the error message is at "End Function" Ln 35, Col1 ... Hope that helps ... I'm sure you have made exactly what I need and it will be desperately appreciated!
  20. Elephant

    Price calculations between dates

    Hi again Shay, If for some reason I can't get the "cost" button working, maybe you could tell me how you made that button ... Kiitos paljon! Steve
Back
Top Bottom