Problems with some VB code...

Soldato
Joined
7 Jan 2003
Posts
4,458
Location
Gold Coast, Australia
Could i have a hand working out what this code means please, havnt done much VB before and im trying to work out whats going on here.

Thanks in advance.

Private Sub makebooking(bookingnumber As Integer)
Dim instructornumber As Integer
Dim bookingtime As Double
If Left(Me.Controls(bookingnumber), 1) <> "~" Then
MsgBox "This is not a free slot"
Exit Sub
End If
instructornumber = bookingnumber \ 11 + 1
bookingtime = ((bookingnumber Mod 11) * 1 / 24) + 9 / 24
MsgBox bookingtime
'MsgBox instructornumber
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmMakeBooking"
DoCmd.OpenForm stDocName, acNormal, , , acFormAdd

Forms!frmMAkebooking.Date = Forms!frmTimetable.txtDate
Forms!frmMAkebooking.InstructorID = instructornumber
Forms!frmMAkebooking.Time = bookingtime

'MsgBox bookingtime & " " & staffnumber
End Sub
'This routine decreases the date by one day and then updates the data on the timetable
 
Associate
Joined
5 Feb 2004
Posts
342
Location
Rotherham
Well...I'm no expert with VBScript, just getting into it myself, but it looks to be some sort of room booking software.
If the room number is unavailable then it comes back saying that it is unavailable.
 
Back
Top Bottom