If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
text field formatting
i m using access 2003 and designing one forms which has
two text field..one for name and another for address.. in address field, i have multiple line enabled and i want to resrict to maximum number of lines only to 3. in the name field, i want to change string to proper once focus is lost..i.e. mr. abc xyz--------Mr. Abc Xyz MR. ABC XYZ--------Mr. Abc Xyz and address text field can have maximum 3 lines..user should not be able to enter 4th line.. any help would be appreciated.. thnx in advance dave |
#2
|
|||
|
|||
You can put the following code in the before update event
If IsNull(Me.Address) = False Then If UBound(Split(Me.Address, vbCrLf), 1) 2 Then Cancel = True MsgBox "You are only allowed 3 lines max", vbExclamation End If End If The split command produces a zero based array...so, "2" means 3 lines.... -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada http://www.attcanada.net/~kallal.msn |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Must # of fields in the 2 tables in an Append Query be equal? | CreativeImages | Running & Setting Up Queries | 3 | October 1st, 2004 05:16 PM |
Can you prevent the text following a text form field from shiftin. | ldickers | General Discussion | 1 | September 16th, 2004 09:50 PM |
Printing text field on a report with leading and ending "*" | Jim Halbert | General Discussion | 1 | July 28th, 2004 12:29 AM |
Linked Table field...strip off leading zeros of text | Inyo55 | Database Design | 1 | July 24th, 2004 01:11 AM |