DeepTrouble
Registered User.
- Local time
- Today, 20:52
- Joined
- Apr 24, 2001
- Messages
- 18
Thanks in Advance for the solution!
The database in question is for a medical laboratory, which has six different sections.The specimen entry is planned through this database. In the Data entry form, a specimen number is generated automatically. However, each section of the lab wants their own serial number.I have tried this as follows, but ofcourse doesn't work! Please note, I am not a Computer graduate, and so have more ignorance than knowledge)
Private Sub Specimen_Number_LostFocus()
Dim db1 As Database
Dim rshepatitis_c As Recordset
Dim inthep_no As Integer
Dim hep_no As Integer
Set db1 = CurrentDb
Set rshepatitis_c = db1.OpenRecordset("HEPATITIS C")
[hep_no] = 1
While Not rshepatitis_c.EOF
rshepatitis_c.Edit
rshepatitis_c![hep no] = rshepatitis_c.RecordCount + 1
rshepatitis_c.Update
rshepatitis_c.MoveNext
Wend
End Sub
Where: HEPATITIS C IS A TABLE
HEP_no IS IS THE FIELD( WHICH NEDDS TO BE UPDATED) IN TABLE
Can I use the same VB for other sections?
Any solutions? Alternates are welcomed as well!
The database in question is for a medical laboratory, which has six different sections.The specimen entry is planned through this database. In the Data entry form, a specimen number is generated automatically. However, each section of the lab wants their own serial number.I have tried this as follows, but ofcourse doesn't work! Please note, I am not a Computer graduate, and so have more ignorance than knowledge)
Private Sub Specimen_Number_LostFocus()
Dim db1 As Database
Dim rshepatitis_c As Recordset
Dim inthep_no As Integer
Dim hep_no As Integer
Set db1 = CurrentDb
Set rshepatitis_c = db1.OpenRecordset("HEPATITIS C")
[hep_no] = 1
While Not rshepatitis_c.EOF
rshepatitis_c.Edit
rshepatitis_c![hep no] = rshepatitis_c.RecordCount + 1
rshepatitis_c.Update
rshepatitis_c.MoveNext
Wend
End Sub
Where: HEPATITIS C IS A TABLE
HEP_no IS IS THE FIELD( WHICH NEDDS TO BE UPDATED) IN TABLE
Can I use the same VB for other sections?
Any solutions? Alternates are welcomed as well!