CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Jan 2009
    Posts
    13

    Exclamation Help with a Sql Statement

    Hi im trying to use a sql statement to save a record in a database the procedure is a follows

    Form (name : frmBooking_Counter)
    txtboxes(SS) (names : txtPassengerName;txtTicketNumber;txtArrival;txtDepartingAirport)
    command button (name: cmdSave)

    I have used this code but it doesnt work may someone help

    Line2 is reporting a type mismatch


    Code:
    Private Sub cmdSave_Click()
    Set rst3 = datReservationRecs.OpenRecordset("select * from Tickets where SS# ='" & [Form3s]!3)[Booking_Counter]![SS] & '";")
    rst3.Save
    rst3![PassengerName] = [Forms]![frmBooking_Counter]![txtPassengerName]
    rst3![TicketNumber] = [Forms]![frmBooking_Counter]![txtTicketNumbers]
    rst3![Arrival] = [Forms]![frmBooking_Counter]![txtArrival]
    rst3![DepartingAirport] = [Forms]![frmBooking_Counter]![txtDepartingAirport]
    rst3![Fare] = [Forms]![frmBoooking_Counter]![txtFare]
    rst3![Class] = [Forms]![frmBooking_Counter]![txtClass]
    rst3.Update
    End Sub
    have used this code but it doesnt work may someone help
    Last edited by HanneSThEGreaT; August 11th, 2009 at 04:26 AM. Reason: Code Tags!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured