Selecting varying number of chars in a textbox

In Access 2003, I need to be able to highlight (select) a substring of the 
text in a textbox for an existing record. For example, if I have a date:

3/10/2009

I might need to highlight the "3/10" part while leaving the "/2009" part 
unhighlighted. This would facilitate data-entry of a month/day while leaving 
the year as-is. I know this is possible, but have forgotten how. Can someone 
please point me in the right direction?

Thanks a million!
0
Utf
3/17/2010 8:05:04 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
762 Views

Similar Articles

[PageSpeed] 39

On Wed, 17 Mar 2010 13:05:04 -0700, Dennis
<Dennis@discussions.microsoft.com> wrote:

Check the help file on SelStart and SelLength.

-Tom.
Microsoft Access MVP


>In Access 2003, I need to be able to highlight (select) a substring of the 
>text in a textbox for an existing record. For example, if I have a date:
>
>3/10/2009
>
>I might need to highlight the "3/10" part while leaving the "/2009" part 
>unhighlighted. This would facilitate data-entry of a month/day while leaving 
>the year as-is. I know this is possible, but have forgotten how. Can someone 
>please point me in the right direction?
>
>Thanks a million!
0
Tom
3/17/2010 10:04:05 PM
Dennis wrote:

>In Access 2003, I need to be able to highlight (select) a substring of the 
>text in a textbox for an existing record. For example, if I have a date:
>
>3/10/2009
>
>I might need to highlight the "3/10" part while leaving the "/2009" part 
>unhighlighted. This would facilitate data-entry of a month/day while leaving 
>the year as-is. I know this is possible, but have forgotten how. Can someone 
>please point me in the right direction?


Use the Enter event:

If Len(Nz(Me.textbox, "")) > 5 Then
	Me.textbox.SelStart = 0
	Me.textbox.SelLength = Len(Me.textbox) - 5
End If

-- 
Marsh
MVP [MS Access]
0
Marshall
3/17/2010 10:33:52 PM
Reply:

Similar Artilces:

Run report on multi selected records.
I try to make a report for a custom entity that works like the Account Summary: let's say that it's Customer's Inquiry Summary for entity Customer's Inquiry I made the report so that I'm able to run the report on Customer's Inquiry Form. But when I select multi records in the list of Customer's Inquiry and run report, only one record is show in one page of the the report. I would like to have the selected records appear in the report with each record on each page. How can I do this? ...

Combo box list selection based on earlier selection by user
HI, I have a form that has a combo box 1 (Product) that reads a the Product table and has a unique id attached to each product (RO#). There is a second combo box 2 that is RO#. Now what I would like to do is when a user selects a Product in combo box 1, the system should lookup the Product selected from combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I am using both combo boxes as Unbound and in the combo box 2 I have the two columns Product and RO# - in the Criteria row of RO# I have the following: Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![x...

Can't select objects in Excel 2007
I'm trying to create a form in Excel 2007, and although I can manipulate, copy & paste controls (check boxes, etc) I can't select multiple objects to align them, etc. I've checked on-line help (and have followed the instructions), and other websites, but no one seems to have indicated a problem. It is extremely cumbersome and I need a solution. Any ideas? Thanks in advance, Jim Berglund I know this is about a year too late, but it may help others who have stumbled across this page looking for similar help. On the Home tab, in the Editing group, click Find & Select....

MS Access Customizing an Auto Number
Hi - I would like to create my own auto number. It should include: project acronym+date+#### Example: 65947WHB-CAE_042210-0001 I have a table set up that I can pull the project acronym from, the date would be the date entered into the database, the number would generate automatically. What is the best way to do this? Thanks for your help. April On Thu, 22 Apr 2010 14:08:03 -0700, April Klein <April Klein@discussions.microsoft.com> wrote: >Hi - > >I would like to create my own auto number. It should include: > >project acronym+date+###...

Lot Selection not Showing when I select PO on Receiving Entry
Usually, the Lot selection screen would pop up when I select a PO at the Line Detail of the Receivings Entry, now it does not! And GP will let items post without a lot number! It seems as if a setting has changed. Any ideas anyone? Any help is appreciated. Thanks, R Are you sure the item is marked to track lots? This wiould be set item by item on the Item Maintenance Options window. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com &q...

Select contact then hangs
Hi, please help. I have a user that when she selects a contact using To: in a new email, after selecting 2, it closes outlook??. Spec is W2kSP4\office2k with all windows updates and office updates installed. Profile has been deleted and re-created, plus i have set up personal folders and moved contacts into there, and set that folder as a default, but makes no difference. Please help. ...

Finding pairs of numbers
Is this possible? I assume this will involve some VB coding also: Part Num Associated Part Num 123 456 789 5623 8521 6352 456 123 5478 9821 444444 AT256 5623 789 Formula in "C" that would find the mate and insert a "Pairing" number So that the 1st and 4th rows would have a 1 and the 2nd and 7th would have a 2 etc This subroutine will do it - change the range in first statement to suit you needed Sub tryme() Set testrange = Range("A1:C20") For j = 1 To testrange.Count - 1 testA = testrange(j, 1) & testrange(j, 2) Fo...

Workbook Numbering
In Excel XP, I have multiple worksheets in a workbook. In the footer for each worksheet I am trying to insert the page number regarding the total number of pages in the entire workbook (i.e. Page 10 of 25). I group all the sheets together yet for each sheet, the page number is just listed as page 1 or 2 for that sheet. Can anyone help? Thanks. Jason You need to print the sheets as a group. So select all of the sheets and then print Good Luck Mark Graesse mark_graesser@yahoo.co Boston M ----- Jason S wrote: ---- In Excel XP, I have multiple worksheets in a workbook I...

Incremental numbering
I have a created an Excel spreadsheet for printing labels. I need to be able to incrementally increase each label count by one, which I can do with no problem. I can not figure out how to increase by one if there is a word in front of it. Example the first label would be: WORD 1001 The second label would be: WORD 1002 The WORD would stay constant, but the numbers would change. I would also like display a dialog box to ask the user what the starting number would be and then automatically prefill the sheet. Any suggestions? Thanks, Jeff not sure this is the best way but here is how i ...

Selecting rows from various sheets
Hi all, I have several sheets with a few columns in each. One colum in each sheet has a unique value. Most of these unique values are th same in each sheet but not all. Is there any way that I can set up new sheet that will have the unique value in column 1 and th corresponding column values frommeach sheet beside it. For example Sheet 1 aa 1 1 1 bb 2 2 2 cc 3 3 3 Sheet 2 aa 4 4 cc 5 5 Result aa 1 1 1 4 4 bb 2 2 2 cc 3 3 3 5 5 Thanks alot, Sha -- sha ----------------------------------------------------------------------- shav's Profile: http...

numbering text boxes?
Is there a way to number text boxes in a document? I'm trying to create coupons that I can number, putting 3 to a page, so I'd need to number the text boxes rather than the pages. Mail merge... Setup a data base list with numbers. Lots of help here Mail merge http://office.microsoft.com/en-us/publisher/CH010504371033.aspx -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Lisa" <Lisa@discussions.microsoft.com> wrote in message news:5D77331E-3B4A-47B4-BC9B-50FA4E883555@microsoft.com... > Is there a way to nu...

Inserting ID Number from Another Table
Hello, I have two tables. One stores "employee information" and another stores "time sheet information" for all the employees. The "Employees" table has a unique identifier for each employee (EmployeeID). The "Time Sheet" table also has a unique identifier for each time sheet entry (TimeSheetID). When the data entry person inputs time sheet information onto the "TimeSheet" table, she selects the employee from a combo box which combines the first and last name of the employee from the employee table. What I want to do is automatically inse...

select text in Calendar
I'm working on a calendar in Publisher. I'm adding text into a cell by spacing down 1 point, then typing in 8 points. Doing fine until April. At that time, I can only select cells (whole days). It will not let me select the text. Help is no help. Any hints out there. Did I accidentally select something to do this? Bonnie Have you added a picture to the cell or a shape? If you have send it to the back, make the cell no fill and try again. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "GoBonnieGo" <GoB...

Number Formatting in XL
I am normally using the "Comma"-format with 0, 1 or 2 decimals. However, lately when I am trying to cut down from the default 2 decimals to 1 or 0, the number is showing up with two commas, and a number of 0s added after the last comma. One example; 10,00 becomes 10,0,000 when I try to reduce it to 10,0 Anyone with a cure for this disease? Hi what format have you applied exactly? -- Regards Frank Kabel Frankfurt, Germany "Zyvind" <Zyvind@discussions.microsoft.com> schrieb im Newsbeitrag news:EB775E31-21D0-4D17-AC7F-3030A5A2AF37@microsoft.com... > I am nor...

macro to filter data based on selected data
Hi, I am looking for a macro that requests input of a reference code and then a date and then filters the data in my spreadsheet based on this criteria. I am using excel 2007. Any help with this will be greatly appreciated. You can probably record a macro while doing it manually and then clean it up and add input boxes to ask the question or input your variable in a cell and use that. If all else fails, If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the ...

Link select with a blast
I have Win 7 Home Premium, x64. Quite often, when I select a link, a mouse pointer changes to a palm with a blast. I understand, the palm is the standard mouse pointer for link select, but what is the blast? What it indicates? -- Ilya Zeldes Fort Myers, Florida Hi Ilya, I suspect that this is being caused by a tracking program. Run something like Ad-Aware and see if it indicates a tracking company. If so, you can delete it, however, it might prevent you from accessing that particular website. Dave "Ilya Zeldes" wrote in message news:7A6FF9B1-5512-44...

Counting number of records based on criteria
Hello, (Try again to get the question in the google-groups. Perhaps not pushed on the send button). For counting records as expression in a report in ms.access I'm using =count(*) which shows all records. Now I also want to know how many of them has registered a specific data in a specific field. I'm trying to use =count([Field1]="999") to count how many of the selection reported has registered data 999. This option isn't work. Can somebody give me the correct solution. thanks, Johan The 999 needs to go in the criteria for the query driving the...

Select Case in a Change Event
Hi, I am trying to use a worksheet Change Event to trap changes to specific columns. depending on which column is chnaged by the user, the value in another ciolumn will be altered; so, changes in either column O or P will update column Q, changes in either column T or U will update column V and changes in column Z or AA will update column AB. What I can't figure out is the Select Case bit (where I've got the shouted question below). Here's what I've put together, any comments would be much appreciated. Private Sub Worksheet_Change(ByVal Target As Range) ...

Select Records based another table...
This may be very elementary, but i can't wrap my brain around it. I have tried to dummy it down as much as i can for myself, with plans of adapting it into something working. I have three tables that look like the following: Tbl 1: ProdID A B C 1 $1 $2 $3 2 $4 $5 $6 3 $7 $8 $9 Tbl 2: RmNum ProdID 1 3 1 2 2 1 2 2 Tbl 3: RmNum Style 1 A 2 C Relationships are: [tbl1 ProdID] ------ [tbl2 ProdID] [tbl2 RmNum] ...

Coordinating tracking numbers !
I have make reciept books , 50 to each pack with tracking numbers.. now the problem iam have is that when i print 4 to 1 page, it does ok to set each number in sequance, it seems... but if i print a pile of pages and it comes time to cut that stack into 4 , i run into trouble.. then i realize the numbers dont go in order in their own little stacks..that eachnumber below that is not the right number, so after i have to go and put them all in order by hand ..thats crazy must be a better way. I do similar with chances (5 to a page). When you do the merge for the numbers you need to use 4...

Multi-Select List Box Does Not Retain Selected Items
I created an Outlook Form in 2003. But when I select items in the list box they do not remain select when I select another control on the form. Any suggestions? Did you bind the list box to a keywords field? -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "kaykay" <anonymous@discussions.microsoft.com> wrote in message news:276dd01c4638d$bd5af590$a501280a@phx.gbl... > I created an Outlook Form in 2003. But when I select > items i...

VBA
I am very new to VBA and access and have a question regarding a SELECT statement. I am going to run a select (recordset - so I can loop through and process each record) but on my SELECT I want to make sure I return at least 20 rows, otherwise I am going to change my WHERE clause to include more rows. Is there an easy way to do this or do I need to just do an inital SELECT COUNT(*) and then decide which WHERE clause to use?? Do you have an example I can look at? Thank you in advance! AJ On Fri, 14 Dec 2007 17:14:00 -0800, AJ <AJ@discussions.microsoft.com> wrote: I would not first ...

Drop down list quicker selection
We are using Excel 2003 We created a drop down list using the Data\Validation process, which works fine. When the arrow within a cell is clicked on to show the drop down list, how can you quickly select one of the many names in the list just by typing the first character of a name within the list. At the moment, we have to scroll up and down the list to select a particular name, which in itself isn't a problem, but slows down the process of finding the right name. Can the names within the list be alphabetically grouped when inputting the first character from the keyboard, and spee...

Receipt Number Sequence
Is it possible to have different receipt number sequences to my cash, charge and payments receipts. Can RMS store the numbering of these 3 types of receipts separately? Regards, Terrence Inniss. Terry, Very simple thing, the transaction reference # not on the base on tender type but base on the transaction itself as soon as you start working a single document # generate and will remain till you perform tender or cancel the transaction. So per my knowledge it is not possible, yes may be It could possible if the system first ask you about the Tender Type, but it will be funny if the sy...

numbers on x axis
Hello all, I'm kinda new to this, but I'm learning, so please bear with me. My question is this. I am trying to set up a xy scatter chart to plot points of a test that I take for my job. Only thing is, I would like to change the x axis to read 5, 10, 15, 20, 25, 30, 40, 50, 60. This is the interval at which I take the reading of my test, 5 minutes, 10 minutes, etc. I put the readings in column A1 thru A9. The reading are correct, but the numbers in the x axis read 0, 2, 4, 6, 8, 10. I would like to put A1 on the 5 minute mark, so on and so forth. I am running Microsoft...