Use Access2007 to solve the problem of date capitalization for check printing

Source: Internet
Author: User
Tags ticket

As the Treasurer knows, the date of the transfer check is to be capitalized. If you use handwriting, of course, you can directly fill in the upper case, but if the design of special software to play, each check in a fixed position to fill in the capitalization will be cumbersome and unnecessary. Here only to access2007 design as an example, to this aspect of enthusiasts to provide a way of thinking.

First, design a Access2007 table, add the transfer cheque may need fields, such as the payer name, payer account number, payee name, payment amount, the date of the ticket and so on. The "Out of date" setting is set to the date type, and the default value can be set to "date ()" (that is, today's date). After the table is designed, name save standby.

Second, the new module, and enter the following content

Public Function udate (mdate as Date, myMD as Integer) as String

' Usage udate (#1/2/2005#, i)

' I=1 00 Wu

' I=2 0

' I=3 0

' i=0 00 Wu, 0 days a month

Dim i As Integer, ID as Integer

Dim Strdt (2) As String, STRs as String

Dim STRD (0 to 9) as String * 1

STRD (0) = "0"

STRD (1) = "One"

STRD (2) = "II"

STRD (3) = "three"

STRD (4) = "Restaurant"

STRD (5) = "WU"

STRD (6) = "Land"

STRD (7) = "Qi"

STRD (8) = "ba"

STRD (9) = "Nine"

For i = myMD + (mymd <> 0) to myMD + (mymd <> 0)-(mymd = 0) * 2

If i = 0 Then

ID = year (mdate)

Strdt (i) = STRD (ID 1000) & STRD ((ID) mod) & STRD ((ID) mod) & STRD (ID mod 10)

Else

If i = 1 Then id = Month (mdate) Else id = day (mdate)

If ID > 9 Then strs = "Pick up" Else STRs = ""

Strdt (i) = STRD (ID) & STRs & STRD (ID Mod 10)

If ID > 9 and id Mod = 0 Then Strdt (i) = "0" & left$ (Strdt (i), 2)

End If

Next

Select Case myMD

Case 0

udate = Strdt (0) & "Year" & Strdt (1) & "Month" & Strdt (2) & "Day"

Case Else

Udate = Strdt (mYMD-1)

End Select

End Function

Third, the first step to build a new query based on the table, add the necessary fields. Another write expression in a blank field: "Uppercase: Udate ([Ticket date],0)". Save this query.

In the original table to enter the check information to be printed, "out of the ticket date" field must be entered the correct date.

Five, run the query, you will see an uppercase Date field. With this result, both the design form and the design report can be freely referenced.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.