|
-
Apr 23rd, 2000, 06:31 PM
#2
This works
FYI
This works I had to use an alias to get it to work
Public Sub GetMaxOrderID()
'using a select max with an alias as max_order to get the max value from fldOrderID and store it in a variable
Dim RS As Recordset
Dim plngMaxOrderID
Set RS = gdbCurrent.OpenRecordset("Select MAX(fldOrderID) AS MAX_ORDER from tblOrderMaster " & _
"Where fldCustomerID Like " & " '*" & glngCustomerID & "*'")
plngMaxOrderID = RS![MAX_ORDER]
glngNewOrderID = plngMaxOrderID + 1
RS.Close
End Sub
txtOrderID = glngNewOrderID
[Edited by VB_Sponge on 04-24-2000 at 07:32 AM]
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
|