Mary did you receive the file in the end.
John
User Profile
Collapse
-
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...Leave a comment:
-
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]=#"Leave a comment:
-
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.
JohnLeave a comment:
-
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."
JohnLeave a comment:
-
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
JohnLeave a comment:
-
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.
JohnLeave a comment:
-
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".
JohnLeave a comment:
-
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]=#"Leave a comment:
-
Im sorry to say the code has no effect. I dont know what else to try.
Any ideas?
Thanks for your time anyway.
JohnLeave a comment:
-
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]=#"Leave a comment:
-
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...Leave a comment:
-
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],Leave a comment:
-
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
JohnLeave a comment:
-
Just to let the know the error is "Compile error: variable not defined"Leave a comment:
-
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
...
No activity results to display
Show More
Leave a comment: