1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problems with some VB code...

Discussion in 'Windows & Other Software' started by demon8991, 29 May 2006.

  1. demon8991

    Mobster

    Joined: 7 Jan 2003

    Posts: 4,406

    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
     
  2. Pyrosoft

    Gangster

    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.
     
  3. demon8991

    Mobster

    Joined: 7 Jan 2003

    Posts: 4,406

    Location: Gold Coast, Australia

    Ohhh cheers mate that makes sense fits in with what i was trying to do.

    Thankyou very much.
     
  4. Pyrosoft

    Gangster

    Joined: 5 Feb 2004

    Posts: 342

    Location: Rotherham

    No problem if that's all you're after :p
    The variable names look pretty self explanitory for it anyway :)