Give us your idea about what this serial number should resemble - including whether your serial number can allow duplicates. And by the way,
CDbl(CDate([TextField])) IS a valid code snippet if you put the correct value in place of [TextField]. If you have a control then put the name of the control there. If you have a field in a record, that is what goes in place of the [TextField] argument. This is what the VBA code might look like.
a = "#01/23/2022#"
b = CLng(Cdate(a))
c = CDbl(Cdate(a))
In these examples if I allow A, B, and C to be VARIANT data types, A will become a string. B will become a long integer (32-bit). C will become a double precision floating number. If your input string is not formatted as a true date (which
mmddyyyy isn't), then Access CDate function will still try to convert it, but if you don't provide proper punctuation and if both mm and dd are less than 12, you can have a problem depending on how you set things up. See, for example,
How to ensure dates and times are correctly recorded in Microsoft Access databases, and then used in queries, forms and reports
www.consultdmw.com
Your question, because it leaves some parts ambiguous, is actually trickier than you might have thought.