User Profile

Collapse

Profile Sidebar

Collapse
johnblack
johnblack
Last Activity: Mar 5 '07, 06:11 PM
Joined: Feb 19 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • johnblack
    replied to Double Booking Problem
    Mary did you receive the file in the end.
    John
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Stop Duplicates
    Thanks for your help.
    With this code I can not click out of cells as before. When I try to i get a message of "(PitchID=1 ) AND (ScheduleDate=# 2/27/2007#)" for example when I enter a PitchID of 1 and a ScheduleDate of 27/02/2007.

    This means I can not add or edit records as before as all I can do is press ok on the message box and then press escape to revert to the record as it was before.

    Hope this...
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Sorry been away for a few days.
    For this code:
    Code:
        Set rs = db.OpenRecordset("SELECT [ScheduleStartTime], [ScheduleEndTime] " & _
           "FROM Schedule INNER JOIN ScheduleDetails " & _
           "ON Schedule.ScheduleID=ScheduleDetails.ScheduleID " & _
           "WHERE [CourtID]=" & Me.[BookingsSubform].Form![CourtID] & _
           "AND [ScheduleDate]=#"
    ...
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Sorry no i havent moved that code yet. Which part do i replace
    i know its a silly question but i had ago and the code went red.
    John
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Yes i moved it to the after update event. I am still getting this error "run time error 2465, MS access can not find the field 'I' referred to in your expression."

    John
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Ok it likes schedule on its own not tblschedule. Thanks this gives me a list of doubles bookings, is there any way I can stop these from being entered in the first place.

    Thanks
    John
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    I did what you said and got an error of "The Microsoft Jet database engine cannot find the input table or query tblSchedule. Make sure it exists and that its name is spelled correctly. (Error 3078)" when trying to run the query.
    I have checked spellings and they are correct.

    John
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    I tried to create the query in SQL view with bookings instead of mainform is that right? But i could not save it due to an error of "Syntax error in FROM clause".

    John
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Thanks for your continued help.

    Code:
        Set rs = db.OpenRecordset("SELECT [ScheduleStartTime], [ScheduleEndTime] " & _
           "FROM tblSchedule INNER JOIN tblScheduleDetails " & _
           "ON tblSchedule.ScheduleID=tblScheduleDetails.ScheduleID " & _
           "WHERE [CourtID]=" & Me.[BookingsSubform].Form![CourtID] & _
           " AND [ScheduleDate]=#"
    ...
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Im sorry to say the code has no effect. I dont know what else to try.
    Any ideas?
    Thanks for your time anyway.
    John
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Mary, thanks for your time on this.

    Code:
        Set rs = db.OpenRecordset("SELECT [ScheduleStartTime], [ScheduleEndTime] " & _
           "FROM tblSchedule INNER JOIN tblScheduleDetails " & _
           "ON tblSchedule.ScheduleID=tblScheduleDetails.Schedule  ID " & _
           "WHERE [CourtID]=" & Me.[BookingsSubform].Form![CourtID] & _
           " AND [ScheduleDate]=#"
    ...
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    I am trying to not allow double bookings to be entered in the form. This involves not allowing a particular court to be booked on a particular date for a time that is already taken. For example
    Court 1, 18/02/07, 11:00 AM - 01:00 PM and
    Court 1, 18/02/07, 11:00 AM - 12:00 PM and
    Court 1, 18/02/07, 11:00 AM - 01:00 PM should not be allowed as there are repeats and overlaps

    But other entries such as
    court...
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Sorry if i am a slow understandig what you guys mean but i am a newbie to VBA. Now i have this code:
    Code:
        strWhere = "(([CourtID]=" & Me.[BookingsSubform].Form![CourtID] & _
                   ") AND ([ScheduleDate]=" & Me.[BookingsSubform].[Form]![ScheduleDate] & _
                   ") AND ([BookingsTimeSubform].[Form]![ScheduleEndTime]>=#" & _
                   Format(Me.[BookingsTimeSubform].[Form]![ScheduleStartTime],
    ...
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Ok i have moved the code to the before update event (thanks Mseda) but double bookings are still allowed (the code has no effect). Any ideas from anyone regarding the code.
    Thanks
    John
    See more | Go to post

    Leave a comment:


  • johnblack
    replied to Double Booking Problem
    Just to let the know the error is "Compile error: variable not defined"
    See more | Go to post

    Leave a comment:


  • johnblack
    started a topic Double Booking Problem

    Double Booking Problem

    I am creating a tennis court booking system. I am trying to create a macro that will not allow the same court to be booked on the same date at the same time.

    I have the following tables and fields

    tblMembers
    MemberID
    FirstName
    LastName
    etc

    tblCourts
    CourtID
    CourtName

    tblSchedule
    ScheduleID
    ScheduleDate
    CourtID

    ...
    See more | Go to post
No activity results to display
Show More
Working...