ClaraBarton
Registered User.
- Local time
- Yesterday, 22:50
- Joined
- Oct 14, 2019
- Messages
- 695
I'd like to insert a record:
But if the Num field is null I get a comma after CkDate:
INSERT INTO tblTransactions ([fAccountID], [fNameID], [CkDate], [Num]) VALUES (42, 43694, 7/16/2025, )
I could rearrange the fields, I guess but is there a better way to handle this?
Code:
strSql = "INSERT INTO tblTransactions" & _
" ([fAccountID]" & _
", [fNameID]" & _
", [CkDate]" & _
", [Num])" & _
" VALUES" & _
" (" & Me.cboAccount.Value & _
", " & frm.cboFullName.Value & _
", " & frm.CkDate & _
", " & Nz(frm.Num, "") & ")"
INSERT INTO tblTransactions ([fAccountID], [fNameID], [CkDate], [Num]) VALUES (42, 43694, 7/16/2025, )
I could rearrange the fields, I guess but is there a better way to handle this?