Question : Invalid Use of Null

I'm trying to insert into a table using DoCmd.RunSQL.  I first fill the variables from the form controls, but when I try to insert any empty txtDOB I get this error message: "Invalid Use of Null" - I assume by adding empty strings to the end of the First and Last Name that I can insert empty values into the table for strings... but how do you do this for dates that are allowed to still be empty?

intPPANum = Me.txtPPANum.Value
strFirstName = Me.txtFirstName.Value & ""
strLastName = Me.txtLastName.Value & ""
datDOB = Me.txtDOB.Value

DoCmd.RunSQL "INSERT INTO tblPPA (intPPAID, txtFirstName, txtLastName, txtDOB) Values (" & intPPANum & "," & strFirstName & "', '" strLastName & "', #" & datDOB & "#);"

Answer : Invalid Use of Null

Because dual channel works best if the same type of RAM is in the same color slot.  Crucial can be in either yellow or black, but whichever you choose has to have both sticks in the same color.  Typically, one does not have to care about this because one would buy four sticks of RAM that are all identical.
Random Solutions  
 
programming4us programming4us