ok I was generating a combo of things into a unique identifier.
Private Sub generatenumber( )
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim StudentNumber As Integer
Set db = CurrentDb
Set rs = db.OpenRecordse t("SELECT Max(qryParticip antids.gennumbe r) AS
MaxofGenNUMBER FROM qryParticipanti ds;")
If rs.RecordCount > 0 Then
rs.MoveFirst
Me.GenNUMBER = rs!maxofGenNumb er + 1
Me.StudyID = "S" & Format(Me.GenNU MBER, "0000")
End If
rs.Close
Set db = Nothing
End Sub
so they get a studyID sequence
S0001
S0002
S0003
this worked fine but now they want to get a studyID
S0501
S0502
S0503
how can I get this with an empty recordset.
since the IF is not really needed since you call this on new record
the count will always be 1.
thanks for any ideas...this is weird
why do they always want something that to me makes no since.
Jerry
Private Sub generatenumber( )
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim StudentNumber As Integer
Set db = CurrentDb
Set rs = db.OpenRecordse t("SELECT Max(qryParticip antids.gennumbe r) AS
MaxofGenNUMBER FROM qryParticipanti ds;")
If rs.RecordCount > 0 Then
rs.MoveFirst
Me.GenNUMBER = rs!maxofGenNumb er + 1
Me.StudyID = "S" & Format(Me.GenNU MBER, "0000")
End If
rs.Close
Set db = Nothing
End Sub
so they get a studyID sequence
S0001
S0002
S0003
this worked fine but now they want to get a studyID
S0501
S0502
S0503
how can I get this with an empty recordset.
since the IF is not really needed since you call this on new record
the count will always be 1.
thanks for any ideas...this is weird
why do they always want something that to me makes no since.
Jerry
Comment