VBA Coding & Database work

Discussion in 'Programming' started by Phantom-DXH, Dec 4, 2007.

  1. #1
    Hey,

    I'm developing a cinema booking and membership system for my A-Level computing coursework and i'd just like a lil help with the final bit of my booking form.

    I've included a screenshot of the booking form to show you what it looks like. Anyway heres the coding i wrote, I can't test it til i go into college soo its just there. Hopefully someone can spot some errors or see if i'm going about it the wrong way. I am honestly just guessing my way through the last leg of this database work since i don't have a clue.

    
    Sub AddRecord
    	Dim objRS As New ADODB.Recordset
    
    	objRS.Open "Bookings", CurrentProject.Connection, adOpenDynamic,
     adLockOptimistic
    
    	objRS.AddNew
    		objRS("Text15") = "Membership ID"
    		objRS("List32") = "Film Title"
    		objRS("List32") = "Certificate"
    		objRS("Text41") = "Date"
    		objRS("Cost") = "Paid"
    	objRS.Update
    End Sub
    Code (markup):
    The point of this code is to get data off of this form and save it into the bookings Table.

    Thanks for any help. If you need me to tag the picture with what each item is called, just ask. That code is going to be linked to a button called Book Ticket.
     

    Attached Files:

    Phantom-DXH, Dec 4, 2007 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    hi
    Everything looks ok

    But you need to do formatting of form ,Like form should show name of form

    move evrything to center of page the top part specially which says"Are they member"

    Use some validations and checks before you write to DB
    Regards

    Alex
     
    kmap, Dec 4, 2007 IP
  3. Phantom-DXH

    Phantom-DXH Peon

    Messages:
    72
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I just realised something, will the fields being filled in with this data automatically add the booking ID which is an auto number ?? & How would i go about making it create a report for it to print out ?

    Cheers
     
    Phantom-DXH, Dec 4, 2007 IP
  4. iwyrobi

    iwyrobi Peon

    Messages:
    91
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if you set the booking ID with auto number on database, then yes this will automatically add the new number.

    in what application did you work? access ? or vb ?
    you can use report designer or crystal report to create a report.
     
    iwyrobi, Dec 5, 2007 IP