Hey all,
I'm trying to move a record from reservation to actual mutation.
It's almost done just the last bit of deleting the record in the reservation table us not working. It gives the data type mismatch error. I've tried several things but I'm missing something and that's what I need some help for.
Complete code for this button:
It gives the error on the bolded line of code.
I'm trying to move a record from reservation to actual mutation.
It's almost done just the last bit of deleting the record in the reservation table us not working. It gives the data type mismatch error. I've tried several things but I'm missing something and that's what I need some help for.
Complete code for this button:
Code:
Private Sub Doorboeken_Click()
' Variabelen definiëren voor het vasthouden van data
Dim AF_zaagbreedte, AF_lengte, AF_ordnr, AF_datum, VRID As String
Dim ReserveringID As Integer
Dim strSQLApp, strSQLDel As String
' Laden variabelen met de data op het formulier
AF_zaagbreedte = Me.RES_zaagbreedte
AF_lengte = Me.RES_lengte
AF_ordnr = Me.RES_offertenr
AF_datum = Me.RES_datum
VRID = Me.VRID
ReserveringID = Me.VRRESID
strSQLApp = "INSERT INTO VRMUTSTAF (AF_zaagbreedte, AF_lengte, AF_ordnr, AF_datum, VRID) VALUES ('" & AF_zaagbreedte & "', '" & AF_lengte & "','" & AF_ordnr & "', '" & AF_datum & "', '" & VRID & "')"
[B] strSQLDel = "DELETE FROM VRRESSTAF WHERE VRRESID = '" & ReserveringID & "'"[/B]
' SQL runnen om data over te zetten en te verwijderen
DoCmd.RunSQL (strSQLApp)
MsgBox ReserveringID
DoCmd.RunSQL (strSQLDel)
MsgBox "The Record has been moved"
End Sub
It gives the error on the bolded line of code.