MS Access 2010
I am adding a single record to a Table PEFDonationsCong with one of the field names CongID which is numeric.
A button click is supposed to add the record from the Form to the table
Debugging, I get the correct value integCongID = 256 but strQL still displays:
INSERT INTO PEFDonationsCong (CongID) VALUES (integCongID) and not 256
1. Since it does not recognise the VALUE it requests the parameter value and will correctly append the record
1. If I replace integCongID with the number 256 the sub will continue and add a record with the correct number
I have searched for days and cannot get it to accept a VALUE
I would really appreciate any help here
I am adding a single record to a Table PEFDonationsCong with one of the field names CongID which is numeric.
A button click is supposed to add the record from the Form to the table
Code:
Private Sub AddCong_Click()
Dim strSQL As String
Dim integCongID As Integer
integCongID = Me.ComboCongID
strSQL = "INSERT INTO PEFDonationsCong (CongID) VALUES (integCongID)"
DoCmd.RunSQL strSQL
End Sub
Debugging, I get the correct value integCongID = 256 but strQL still displays:
INSERT INTO PEFDonationsCong (CongID) VALUES (integCongID) and not 256
1. Since it does not recognise the VALUE it requests the parameter value and will correctly append the record
1. If I replace integCongID with the number 256 the sub will continue and add a record with the correct number
I have searched for days and cannot get it to accept a VALUE
I would really appreciate any help here
Last edited by a moderator: