Calculation problem, please help

arifmasum

Registered User.
Local time
Tomorrow, 02:37
Joined
Dec 10, 2007
Messages
72
Greetings to everyone.
I am working on an account related database.
There Debit Voucher number syntax is D9997 1207, where 9997 is the debit number, 1207 is the month and year and D for debit which updates in the form when I put the field value paid to/from.
Problem is the number does not increases after 9999, why so? what sould I do?
Thank you very much.

Arif Masum:confused:
 
Check the; "Field Size", "Format", "Input Mask" properties, (int the table and form).
 
Thanks

Thanks, it helped me, i want the field value to increase automatically..

Possible?

What to do then?

Thanks for your reply again...:D
 
Hello Arif!

Maybe it can be done, but it demand a VBA programing. It would be better to write this value (D09997 1207) in 3 fields, (f1 = "D", f2 = 09997, f3 = 1207).
Try to separated this in 3 fields.
 
Thanks more....

Maybe it can be done, but it demand a VBA programing. It would be better to write this value (D09997 1207) in 3 fields, (f1 = "D", f2 = 09997, f3 = 1207).
Try to separated this in 3 fields.

======================================================

Thank you very much.
I am giving the code here, but disappointed its not working..
Can you give me any advice?

Thanks.

Private Sub Combo12_Click()
Dim dbs As Database, rst As Recordset
Dim SSTR, searchSTR As String
Dim CalNo, MM, V, YR As Variant
Set dbs = CurrentDb
SSTR = "SELECT * FROM [DrTmp] ORDER BY [VFNO] DESC;"
Set rst = dbs.OpenRecordset(SSTR)
rst.MoveFirst
MM = Str(Month(Date))
If Val(MM) <= 9 Then
MM = "0" + Trim(MM)
End If
YR = Mid(Str(Year(Date)), 4, 2)
If IsNull(Forms!DrVoucher!Text1) Then
CalNo = Mid(rst!VFNO, 2, 5)
V = Val(CalNo) + 1
If V >= 1 And V <= 9 Then
CalNo = "D0000" + Trim(Str(V))
ElseIf V > 9 And V <= 99 Then
CalNo = "D000" + Trim(Str(V))
ElseIf V > 99 And V <= 999 Then
CalNo = "D00" + Trim(Str(V))
ElseIf V > 999 And V <= 9999 Then
CalNo = "D0" + Trim(Str(V))
ElseIf V > 9999 And V <= 99999 Then
CalNo = "D" + Trim(Str(V))
End If
CalNo = "D" + Trim(Str(V)) + MM + YR
Forms!DrVoucher!Text1 = CalNo
End If
If IsNull(Forms!DrVoucher!Text20) Then
Forms!DrVoucher!Text20 = "D"
End If
If IsNull(Forms!DrVoucher!Text5) Then
Forms!DrVoucher!Text5 = Date
End If
'If IsNull(Forms!DrVoucher!Actrns!Text92) Then
' Forms!DrVoucher!Actrns!Text92 = Forms!DrVoucher!Text5
'End If
rst.Close
End Sub
 
Hello Arif!

I improvised something.
Look at "DemoIncriseA2000.mdb", look at Table1, Query1, Form1.
Open Form1 and try.
 

Attachments

I improvised something.
Look at "DemoIncriseA2000.mdb", look at Table1, Query1, Form1.
Open Form1 and try.

Thank you very much Mstef.. U've done a lot for me.. I am so much greatful to you. Hope to get from you. Thanks and best wishes from the deep of my heart.. :D
 
more help needed

Dear Mstef,

I want to put the value of voucher no in two tables Debit Voucher & Transaction Table. Please let me know how can I. Can't the value be in the text box?
Thanks in advance..
 
You can add the new field in your table always, but if this MDB is obtain,
then this field will be empty in an old records.
 
Dear MStef, The Form does not shows the DVNumber and date field. How can I show them? Sorry for bothering you man... Be fine....
 
Be more precise, let me know what do you do and what happen.
 
Thanks my problem solved by me...

Be more precise, let me know what do you do and what happen.

Thanks for your time n reply. I've solved the problem. Actually I was writing code on before update event, It should be after update. I got it man after I wrote you. Thanks again
 

Users who are viewing this thread

Back
Top Bottom