malnus
Jul 11th, 2000, 07:08 AM
I am using a ADO recordset, in which one field is AudotNumber. When I add a new record to the recordset, after updating the recordset, I want to display the value of AutoNumber field, using Msgbox. But this does not show it by any mean. Please help me.
Here is an example code
' These are the fields in the cursor
' StudentID AutoNumber
' Name Character(30)
' FName Character(30)
' Caste Character(20)
' I am using MS-Access database.
RS.Addnew
RS.Fields("Name")=txtName
RS.Fields("FName")=txtFName
RS.Fields("Caste")=txtCaste
RS.Update
MsgBox RS.Fields("StudentID")
But a blank MSBOX is is displayed. How can I solve this problem.
Thanks in advance.
Here is an example code
' These are the fields in the cursor
' StudentID AutoNumber
' Name Character(30)
' FName Character(30)
' Caste Character(20)
' I am using MS-Access database.
RS.Addnew
RS.Fields("Name")=txtName
RS.Fields("FName")=txtFName
RS.Fields("Caste")=txtCaste
RS.Update
MsgBox RS.Fields("StudentID")
But a blank MSBOX is is displayed. How can I solve this problem.
Thanks in advance.