|
-
Sep 27th, 2000, 07:03 AM
#3
Thread Starter
New Member
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|