T
TCD
After being out a while, we are still working on a
process to generate approval codes that would appear to
be random to our staff. We have got it to work for
inputting the individuals name but can't figure out how
to be able to input the date as well. This is the part
that we have that works:
Private Sub cmdInsert_Click()
Dim db As DAO.Database
Dim strSQL As String
Randomize
Set db = CurrentDb
strSQL = "INSERT INTO Table1 "
strSQL = strSQL & "(Code, [Name])"
strSQL = strSQL & " VALUES ("
strSQL = strSQL & (Int((99999 - 10000 + 1) * Rnd() +
10000))
strSQL = strSQL & ",""" & Me!Name & """);"
Debug.Print strSQL
db.Execute strSQL
db.Close
End Sub
Thanks
process to generate approval codes that would appear to
be random to our staff. We have got it to work for
inputting the individuals name but can't figure out how
to be able to input the date as well. This is the part
that we have that works:
Private Sub cmdInsert_Click()
Dim db As DAO.Database
Dim strSQL As String
Randomize
Set db = CurrentDb
strSQL = "INSERT INTO Table1 "
strSQL = strSQL & "(Code, [Name])"
strSQL = strSQL & " VALUES ("
strSQL = strSQL & (Int((99999 - 10000 + 1) * Rnd() +
10000))
strSQL = strSQL & ",""" & Me!Name & """);"
Debug.Print strSQL
db.Execute strSQL
db.Close
End Sub
Thanks