G
Guest
I am trying to create a button in a form that when clicked will select 3
field values from a specific record in a table and insert them into another
table. Here is what I have already coded:
Private Sub cmdUpdate_Click()
Dim HCR, HID, S, Se, Dw, Dd, As String
HCR = [Holding Company Rates]
HID = [HoldingCoID]
S = Me.[HoldingCoID]
Se = "SELECT HCR.[SEP] FROM HCR WHERE HCR.HID = S"
Dw = "SELECT HCR.[Dewitt] FROM HCR WHERE HCR.HID = S"
Dd = "SELECT HCR.[Deduct] FROM HCR WHERE HCR.HID = S"
INSERT INTO tblJob[(SEP[, Dewitt[, Deduct]])]
VALUES (Se[, Dw[, Dd])
End Sub
I am getting a compile error: Expected end of statment fom the line that
begins with INSERT INTO and another error from the line that starts with
VALUES. I cut and pasted the lines from the help in Access thought I was
doing the right thing, what is missing or what have I done wrong?
field values from a specific record in a table and insert them into another
table. Here is what I have already coded:
Private Sub cmdUpdate_Click()
Dim HCR, HID, S, Se, Dw, Dd, As String
HCR = [Holding Company Rates]
HID = [HoldingCoID]
S = Me.[HoldingCoID]
Se = "SELECT HCR.[SEP] FROM HCR WHERE HCR.HID = S"
Dw = "SELECT HCR.[Dewitt] FROM HCR WHERE HCR.HID = S"
Dd = "SELECT HCR.[Deduct] FROM HCR WHERE HCR.HID = S"
INSERT INTO tblJob[(SEP[, Dewitt[, Deduct]])]
VALUES (Se[, Dw[, Dd])
End Sub
I am getting a compile error: Expected end of statment fom the line that
begins with INSERT INTO and another error from the line that starts with
VALUES. I cut and pasted the lines from the help in Access thought I was
doing the right thing, what is missing or what have I done wrong?