Minggu, 17 Januari 2016

[MS_AccessPros] strSQL doesn't work

 


John-
I tried all my best, but the send strSQLTwo doesn't work. Please have a look. Thanks in advance.

Private Sub Command74_Click()
On Error GoTo ErrHandle

Dim strSQL As String
Dim strSQLTwo As String



strSQL = "INSERT INTO tblHotelBooking (PartItineraryCityTourID, HotelID, CurrencyID, BookingStatusID) VALUES(" & Me.PartItineraryCityTourID & _
", " & Me.Parent.HotelID & ", " & ELookup("CurrencyID", "qryGetCurrencyByCountry", "CityID=" & Me.CityID) & ", " & 3 & ")"

Me.Requery

CurrentDb.Execute strSQL, dbFailOnError

        strSQLTwo = "INSERT INTO tblHotelBookingRoom ( RoomTypeID, NumberOfRooms, Budget, HotelBookingID ) " & _
            "SELECT tblPartItineraryCityTourRoom.RoomTypeID, tblPartItineraryCityTourRoom.NumberOfRooms, tblPartItineraryCityTourRoom.Budget, " & _
            ELookup("HotelBookingID", "tblHotelBooking", "PartItineraryCityTourID=" & PartItineraryCityTourID & "AND HotelID=" & Me.HotelID) & " AS HotelBookingID " & _
           "FROM tblPartItineraryCityTourRoom " & _
            "WHERE tblPartItineraryCityTourRoom.PartItineraryCityTourID = " & Me.PartItineraryCityTourID
        
CurrentDb.Execute strSQLTwo, dbFailOnError
        

Me.Parent.subManyRequestGroupForHotel.Requery
Me.Parent.subHotelBookingSelect.Requery



ErrExit:
    Exit Sub
    
ErrHandle:
    Resume ErrExit
End Sub

__._,_.___

Posted by: "zhaoliqingoffice@163.com" <zhaoliqingoffice@163.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

.

__,_._,___

Tidak ada komentar:

Poskan Komentar