Download presentation
Presentation is loading. Please wait.
Published byLogan Henderson Modified over 9 years ago
1
Formatting in VB Please see speaker notes for additional information!
2
Formatting Private Sub txtFormat_Click() Dim wkFirst As Single, wkSecond As Single, wkThird As Single, wkFourth As Single Dim wkFifth As Single, wkSixth As Single wkFirst = 3152425 txtFirst = Format(wkFirst, "Currency") wkSecond = -1734529.23 txtSecond = Format(wkSecond, "Currency") wkThird = 0.125 txtThird = Format(wkThird, "Percent") wkFourth = -4578012 txtFourth = Format(wkFourth, "#,0") txtFourth2 = Format(wkFourth, "###,###,###") wkFifth = 0 txtFifth = Format(wkFifth, "#,0") txtFifth2 = Format(wkFifth, "###,###,###") txtFifth3 = Format(wkFifth, "###,###,##0") wkSixth = -23456.78 txtSixth = Format(wkSixth, "Standard") End Sub
3
Formatting Private Sub txtFormat_Click() txtFirst = Format(txtFirst, "Currency") txtSecond = Format(txtSecond, "Currency") txtThird = Format(txtThird, "Percent") txtFourth = Format(txtFourth, "#,0") txtFourth2 = Format(txtFourth2, "###,###,###") txtFifth = Format(txtFifth, "#,0") txtFifth2 = Format(txtFifth2, "###,###,###") txtFifth3 = Format(txtFifth3, "###,###,##0") txtSixth = Format(txtSixth, "Standard") End Sub
4
Private Sub txtFormat_Click() txtFirst = Format(txtFirst, "Currency") txtSecond = Format(txtSecond, "Currency") txtThird = Format(txtThird, "Percent") txtFourth = Format(txtFourth, "#,0") txtFourth2 = Format(txtFourth2, "###,###,###") txtFifth = Format(txtFifth, "#,0") txtFifth2 = Format(txtFifth2, "###,###,###") txtFifth3 = Format(txtFifth3, "###,###,##0") txtSixth = Format(txtSixth, "Standard") End Sub Formatting
5
MaskEdit ActiveX control Make sure you check your choice. Icon for MaskEdit.
6
MaskEdit
10
Mask characterDescription #Digit placeholder..Decimal placeholder. The actual character used is the one specified as the decimal placeholder in your international settings. This character is treated as a literal for masking purposes.,Thousands separator. The actual character used is the one specified as the thousands separator in your international settings. This character is treated as a literal for masking purposes. :Time separator. The actual character used is the one specified as the time separator in your international settings. This character is treated as a literal for masking purposes. /Date separator. The actual character used is the one specified as the date separator in your international settings. This character is treated as a literal for masking purposes. \Treat the next character in the mask string as a literal. This allows you to include the '#', '&', 'A', and '?' characters in the mask. This character is treated as a literal for masking purposes. &Character placeholder. Valid values for this placeholder are ANSI characters in the following ranges: 32-126 and 128-255. >Convert all the characters that follow to uppercase. <Convert all the characters that follow to lowercase. AAlphanumeric character placeholder (entry required). For example: a – z, A – Z, or 0 – 9. aAlphanumeric character placeholder (entry optional). 9Digit placeholder (entry optional). For example: 0 – 9. CCharacter or space placeholder (entry optional). This operates exactly like the & placeholder, and ensures compatibility with Microsoft Access. ?Letter placeholder. For example: a – z or A – Z. LiteralAll other symbols are displayed as literals; that is, as themselves. Mask info copied from Microsoft Help
11
MaskEdit 123456 was keyed in to MaskEdBox2. Tab was then pressed to change the focus and see the data in edited format.
12
MaskEdit
13
In both cases - 1234567.89 was keyed in!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.