Sorry to bother again, but i have another question.
I have some records(around 10 Invoices) in the database(Access 97). And when the order entry form loads, i need the next record to be displayed in the invoice textbox (let's say 11 will be display automatically when that form loads).

I've tried using RecordCount this way but it didn't work. deOrderEntry is my DataEnvironment. And OrderEntry is my DEConnection.

Dim dbs As deOrderEntry
Dim rst As Recordset
Dim strsql As String
Dim Records As Long
Dim strRecords As String

Set dbs = New deOrderEntry
Set rst = New Recordset

dbs.OrderEntry.Open "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:Finalised VBPro\Ordersys.mdb"
strsql = "SELECT Customer.CustomerID FROM Customer WHERE Customer.Name = '" & txtCustName.Text & "'"



rst.Open strsql, dbs.OrderEntry
rst.MoveFirst
Records = rst.RecordCount 'count the number of existing records
txtInvoiceNo.Text = strRecords + 1
strRecords = CStr(Records)

Thanks for your help again!