Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    awhittle23 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Location
    England
    Posts
    17
    Sent you a PM with access to the DB.



    You should get what I mean about the peak price. If not just email me or Skype me if your on Skype and I'll try explain more.

  2. #17
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    OK, two major questions and 30 or 40 small questions..

    1) Meet & Greet price: If I have a depart date of June 8 and a return date of June 17, what should the price be? Is it the sum of the prices per day? Or is it the price on the first day times the number of days?
    Now add in the Peak price. What should happen if I depart on a non-peak day 8/6 and 11/6 to 17/6 are peak price days. What should the price be?

    I would add another field, "Yes/No" type, to the "MG_Price" table. Maybe name it "IsPeak". Because there are 360 records, you can pick the days that are peak.


    2) Park and Ride price: using the same dates, how do I calculate the price? (NumOfDays = 15.)
    Can half the days be non-peak and the rest peak? Don't you need some way to determine which days of the 15 days are/could be peak days?

  3. #18
    awhittle23 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Location
    England
    Posts
    17
    The only reason we will use a peak price is to try and deter customer from parking because we may be running out of spaces.
    All i need to do is be able to give an admin the ability to select the enable peak prices option under the admin panel. Once that is enabled the calculation instead of currently looking at the stay price will look at peak price for both MG and PR prices.

    1.) Meet and Greet - The cost is worked out by the number of days you going to be leaving the car with us in a month. So it doesn't matter what the date you book with us. its the month and number of days. so any date in June checks the number of days needed and selects the cost for that number of days. if you book on the 30th of June for 14 days it uses the June month and number of days 14 for the price. if peak is enabled it will use the peak price.


    2.) Park and Ride is similar except we do up to the number of days. So even if you need 9 days you will be charged for the up to 15 price as its more than the 8 days price. at the time of booking if the peak price is enabled then you get charged the peak price cost for that up to number of days. if the peak price is off then you get charged the standard price.

    Currently there are two fields in the Meet_Price, there is stayprice and staypricepeak, this is the same for the Park_Price table too. this then gives me the ability to change prices and when needed for the whole 260 records for peak and off peak prices.


    30-40 small questions... cant wait ;-)

  4. #19
    awhittle23 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Location
    England
    Posts
    17
    You wouldn't know why the send email has stopped working either would you. ???
    it seems when i fix one thing another thing breaks..

    It started off working fine. then it failed with a complie error. I added the references and then it worked fine. and today after adding the reports and queries it stopped again..

  5. #20
    awhittle23 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Location
    England
    Posts
    17
    Quote Originally Posted by awhittle23 View Post
    You wouldn't know why the send email has stopped working either would you. ???
    it seems when i fix one thing another thing breaks..

    It started off working fine. then it failed with a compile error. I added the references and then it worked fine. and today after adding the reports and queries it stopped again..

    I've managed to fix the database so my email has started sending again. had to use a backup as i think i changed too many things and caused a compile error on all of the controls.

    I have put the newest version back on my drive so you can access it when your ready.

  6. #21
    awhittle23 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Location
    England
    Posts
    17
    Any ideas what the best way to get the prices to change to peak with the peak control??

  7. #22
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by awhittle23 View Post
    The only reason we will use a peak price is to try and deter customer from parking because we may be running out of spaces.
    Table "tbl_Carparks" has 5 lots. If only "Moss House" is running out of space, setting the Peak switch will cause ALL of the lots to charge the peak price. Is this correct?

  8. #23
    awhittle23 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Location
    England
    Posts
    17
    Yes, doesn't matter on the actual available slots. on other parking areas. As soon as admin decides he needs to charge peak prices he just needs to enable peak prices.

    Is it possible to have a date control to stop booking on a specific date?

    I've been looking into what would be needed and I can only think of a table view that if I input a specific date then the system will show a message box to say no more booking on that chosen departure date. Again it would be something entered by an admin only.

  9. #24
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Is it possible to have a date control to stop booking on a specific date?
    Yes, but I'll have to think about it for a while......

  10. #25
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    OK, try this..

    I didn't know which form to use, so I used the Peak form for the stop booking date.

    Table "Peak"
    Add a field to table "Peak" named "StopBookingDate", type Date/Time

    Save the table. Set the date to "27/6/16"

    Open form "PeakEnable"
    Add a text box with a control source of "StopBookingDate"
    Set the text box name to "tbStopBookingDate"
    Close/save form



    Open form "frmAddNewCustomer"

    Add a label control.
    Open Properties dialog box
    Tab FORMAT
    Set the caption to "Booking not allowed at this time"
    Set the font color to RED
    Set the visible property to NO

    set these properties:
    width = 2.6667"
    Height = 0.25"
    Top = 0.0833"
    Left = 2.1667"

    Tab OTHER
    Set the name property to "lblNoBooking"
    Save the form




    Press ctl-G (open the IDE)

    Add this code to the form "frmAddNewCustomer" module

    Code:
    Private Sub Form_Load()
        Dim StopBookingDate As Date
        Dim ctl As Control      'Each control on the form
        StopBookingDate = DLookup("StopBookingDate", "Peak")
    
        'disable/enable the controls
        For Each ctl In Me.Controls
            Select Case ctl.ControlType
                Case acComboBox, acTextBox, acCheckBox
                    ctl.Enabled = StopBookingDate > Date
            End Select
        Next
    
        'enable/disable buttons
        Me.btnCalcPrice.Enabled = StopBookingDate > Date
        Me.Command230.Enabled = StopBookingDate > Date
        Me.Command116.Enabled = StopBookingDate > Date
    
        'hide/show label
        Me.NoBooking.Visible = Date > StopBookingDate
    
    End Sub

    Save and quit

    open the dB.
    Goto booking
    Add a booking

    Go to PeakEnable and set the date to "22/6/16"

    Goto booking
    Add a booking ... can you???


    Don't forget to reset the stop booking date to something like "1/1/35" (Jan 1, 2035)



    Instead of a date, this could be changed to be a check box.....

  11. #26
    awhittle23 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Location
    England
    Posts
    17
    Hi Steve,

    I followed your instructions except i created a new table called NoBookings and in there i created the controls as you instructed. Reason for this is i want to be able to implement more than one date so i can book out weekends in the future or specific dates.
    Anyway, once i put your code on and changed the form name to match etc..


    Private Sub Form_Load()
    Dim StopBookingDate As Date
    Dim ctl As Control 'Each control on the form
    StopBookingDate = DLookup("StopBookingDate", "NoBookings")


    'disable/enable the controls
    For Each ctl In Me.Controls
    Select Case ctl.ControlType
    Case acComboBox, acTextBox, acCheckBox
    ctl.Enabled = StopBookingDate > Date
    End Select
    Next


    'enable/disable buttons
    Me.btnCalcPrice.Enabled = StopBookingDate > Date
    Me.Command230.Enabled = StopBookingDate > Date
    Me.Command116.Enabled = StopBookingDate > Date


    'hide/show label
    Me.NoBooking.Visible = Date > StopBookingDate ******* This line errors. i presume its because we labelled the control lblnobooking so once i change this it actually makes the whole form invisible.


    End Sub

    I think the way you have this is once i put a date in the field stopbookingdate, the system will stop me from booking upto tat date.
    Or will it check the list and only stop booking for the dates i list??

  12. #27
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I think the way you have this is once i put a date in the field stopbookingdate, the system will stop me from booking upto tat date.
    Or will it check the list and only stop booking for the dates i list??
    Currently it allow any bookings if today's date is greater than the date in the table.


    Lets see if I understand correctly:

    You want to prevent a booking if today's date (whatever the date is) is entered in the table or between two dates for both MG and PR?


    I'll have to think about this for a while (again) ....... hmmmmmm....



    How far in advance can a booking be made?

  13. #28
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I think I have it sorted out.....
    Attached Files Attached Files

  14. #29
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    this file????

    (Edit: removed file)
    Last edited by ssanfu; 07-25-2016 at 01:12 PM.

  15. #30
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Once more......

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-07-2014, 07:04 AM
  2. Replies: 3
    Last Post: 04-24-2013, 10:44 AM
  3. Replies: 1
    Last Post: 02-12-2013, 03:48 AM
  4. Replies: 10
    Last Post: 12-27-2011, 01:20 PM
  5. Replies: 1
    Last Post: 12-14-2011, 05:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums