Hi John,
I have a form "New Cargo Collection Input" (it is been renamed on the request of user, previously it was "Collection Voucher" , i'm mentioning this because i had many questions regarding this form and you may recall my previous questions) on its subform "NewCargoCollectionInputsubform" there is a Numeric field "CartonNo".
My user's demand was that while doing data entry on the next row "CartonNo" should increment the value of previous records
"CartonNo" and if the sequence breaks he may be able to enter manually new "CartonNo" like:
1
2
3
25
26
and so on like this. I have put the following code on before update event on the subform:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.NewRecord Then
CartonNo.DefaultValue = Chr(34) & CartonNo + 1 & Chr(34)
End If
End Sub
I have tested it, and it works fine. I just need to know for my personal knowledge and information is the event and code
correct. OR there is some other better and professional way to accomplish this task ?
Best regards,
Khalid
__._,_.___
Posted by: Khalid Tanweer <khalidtanweerburrah@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar