cybersardinha
New member
- Local time
- Today, 19:30
- Joined
- Mar 24, 2022
- Messages
- 24
Hi,
I already got a lot of help in the forums and following the advice I have normalised my tables.
I'm trying to write some vba script to add new records to a table but it's failing and I can't figure out why.
This is the code:
Any Ideas
Thanks
I already got a lot of help in the forums and following the advice I have normalised my tables.
I'm trying to write some vba script to add new records to a table but it's failing and I can't figure out why.
This is the code:
Code:
Dim sCertID As String
Dim sPersonID As String
Dim sCertDate As Date
sCertID = "31"
sPersonID = Me.PersonID.Value
sCertDate = Me.CertDate.Value
Debug.Print sPersonID; " + "; sCertID; " + "; sCertDate
Dim strSQL0 As String
Dim strSQL1 As String
Dim strSQL2 As String
strSQL1 = "INSERT INTO tblPersonCert_INSERT_INTO_SQL(PersonID, CertID, CertDate) "
strSQL2 = "Values(" & sPersonID & ", " & sCertID & ", " & sCertDate & ")"
strSQL0 = strSQL1 & strSQL2
CurrentDb.Execute strSQL0
Debug.Print "Saved"
Any Ideas
Thanks