Thought i was being clever here but hit a brick wall i cannot get around.
This is a party database for a Playcentre.
The table has a field for every 15 minutes starting at 10am to 6pm
And there a 3 differant areas, so when a party is booked and a start time is entered i want the form to automaticly work out where the party will be at 15 minutes intervals to stop double booking, ie F = Frame, P = PArty room and A = activity Room
10:00 10:15 10:30 10:45.......etc
Party1 F F F P
Party2 A A P
The 15 minute fields for the time slots are T1000 T1015, T1030 etc.
The code below starts at the part start time and creates fields for every 15 mins upto 2 hours (party duration), giving them the same names as the fields in my table.
What i cannot do is relate these created fileds to my table fields and set to either F, P or A.
Hope this makes sence, any help apprechiated, or abetter way to acheive this
TIA
Code..
Private Sub StartDate_AfterUpdate()
Dim strFieldName As String
Dim strFieldName1 As String
Dim strFieldName2 As String
Dim strFieldName3 As String
Dim strFieldName4 As String
Dim strFieldName5 As String
Dim strFieldName6 As String
Dim strFieldName7 As String
Dim strT1 As String
Dim strT2 As String
Dim strT3 As String
Dim strT4 As String
Dim strT5 As String
Dim strT6 As String
Dim strT7 As String
strFieldName = StartTime
strFieldName1 = StartTime + #12:15:00 AM# ' this adds 15 mins
strFieldName2 = StartTime + #12:30:00 AM# ' this adds 30 mins
strFieldName3 = StartTime + #12:45:00 AM#
strFieldName4 = StartTime + #1:00:00 AM#
strFieldName5 = StartTime + #1:15:00 AM#
strFieldName6 = StartTime + #1:30:00 AM#
strFieldName7 = StartTime + #1:45:00 AM#
strT1 = "T" & Left(StartTime, 2) & Mid(StartTime, 4, 2) this = T1000
strT2 = "T" & Left(strFieldName1, 2) & Mid(strFieldName1, 4, 2) this = T1015
strT3 = "T" & Left(strFieldName2, 2) & Mid(strFieldName2, 4, 2) this = T1030
strT4 = "T" & Left(strFieldName3, 2) & Mid(strFieldName3, 4, 2)
strT5 = "T" & Left(strFieldName4, 2) & Mid(strFieldName4, 4, 2)
strT6 = "T" & Left(strFieldName5, 2) & Mid(strFieldName5, 4, 2)
strT7 = "T" & Left(strFieldName6, 2) & Mid(strFieldName6, 4, 2)
strT8 = "T" & Left(strFieldName7, 2) & Mid(strFieldName7, 4, 2)
Select Case PartyType.Value
'Playframe
Case 1
FinishTime = StartTime + #2:00:00 AM#
PartDuration = DLookup("[Duration]", "PartyTheme", "[Themeid] = 1")
strT1 = "F" this is the bit i am stuck on T1000 need to = "F"
strT2 = "F"
This is a party database for a Playcentre.
The table has a field for every 15 minutes starting at 10am to 6pm
And there a 3 differant areas, so when a party is booked and a start time is entered i want the form to automaticly work out where the party will be at 15 minutes intervals to stop double booking, ie F = Frame, P = PArty room and A = activity Room
10:00 10:15 10:30 10:45.......etc
Party1 F F F P
Party2 A A P
The 15 minute fields for the time slots are T1000 T1015, T1030 etc.
The code below starts at the part start time and creates fields for every 15 mins upto 2 hours (party duration), giving them the same names as the fields in my table.
What i cannot do is relate these created fileds to my table fields and set to either F, P or A.
Hope this makes sence, any help apprechiated, or abetter way to acheive this
TIA
Code..
Private Sub StartDate_AfterUpdate()
Dim strFieldName As String
Dim strFieldName1 As String
Dim strFieldName2 As String
Dim strFieldName3 As String
Dim strFieldName4 As String
Dim strFieldName5 As String
Dim strFieldName6 As String
Dim strFieldName7 As String
Dim strT1 As String
Dim strT2 As String
Dim strT3 As String
Dim strT4 As String
Dim strT5 As String
Dim strT6 As String
Dim strT7 As String
strFieldName = StartTime
strFieldName1 = StartTime + #12:15:00 AM# ' this adds 15 mins
strFieldName2 = StartTime + #12:30:00 AM# ' this adds 30 mins
strFieldName3 = StartTime + #12:45:00 AM#
strFieldName4 = StartTime + #1:00:00 AM#
strFieldName5 = StartTime + #1:15:00 AM#
strFieldName6 = StartTime + #1:30:00 AM#
strFieldName7 = StartTime + #1:45:00 AM#
strT1 = "T" & Left(StartTime, 2) & Mid(StartTime, 4, 2) this = T1000
strT2 = "T" & Left(strFieldName1, 2) & Mid(strFieldName1, 4, 2) this = T1015
strT3 = "T" & Left(strFieldName2, 2) & Mid(strFieldName2, 4, 2) this = T1030
strT4 = "T" & Left(strFieldName3, 2) & Mid(strFieldName3, 4, 2)
strT5 = "T" & Left(strFieldName4, 2) & Mid(strFieldName4, 4, 2)
strT6 = "T" & Left(strFieldName5, 2) & Mid(strFieldName5, 4, 2)
strT7 = "T" & Left(strFieldName6, 2) & Mid(strFieldName6, 4, 2)
strT8 = "T" & Left(strFieldName7, 2) & Mid(strFieldName7, 4, 2)
Select Case PartyType.Value
'Playframe
Case 1
FinishTime = StartTime + #2:00:00 AM#
PartDuration = DLookup("[Duration]", "PartyTheme", "[Themeid] = 1")
strT1 = "F" this is the bit i am stuck on T1000 need to = "F"
strT2 = "F"