From: Peter Marshall on 8 Mar 2010 08:30 I'm looking for a simple way to check that the text entered into a text box contains a slash at the end. I'm assuming VBA that executes On_Exit. -- Peter Marshall Manager Information Services Ohio Coatings Company
From: Tom van Stiphout on 8 Mar 2010 08:37 On Mon, 8 Mar 2010 08:30:18 -0500, "Peter Marshall" <peter.marshall(a)ohiocoatingscompany.com> wrote: if right$(Me.myTextBox,1) = "/" then 'yes it does else 'no it doesn't end if -Tom. Microsoft Access MVP >I'm looking for a simple way to check that the text entered into a text box >contains a slash at the end. I'm assuming VBA that executes On_Exit.
From: Peter Marshall on 8 Mar 2010 08:41 Thank you, Tom. -- Peter Marshall Manager Information Services Ohio Coatings Company "Tom van Stiphout" <tom7744.no.spam(a)cox.net> wrote in message news:gbv9p5dn11cktq8tu55oufq2285722ib10(a)4ax.com... > On Mon, 8 Mar 2010 08:30:18 -0500, "Peter Marshall" > <peter.marshall(a)ohiocoatingscompany.com> wrote: > > if right$(Me.myTextBox,1) = "/" then > 'yes it does > else > 'no it doesn't > end if > > -Tom. > Microsoft Access MVP > > > >>I'm looking for a simple way to check that the text entered into a text >>box >>contains a slash at the end. I'm assuming VBA that executes On_Exit.
From: Jon Lewis on 8 Mar 2010 08:45 Private Sub Text1_Exit(Cancel As Integer) If Not Right(Me.Text1, 1) = "/" Then Cancel = True MsgBox "No '/'", vbExclamation End If End Sub "Peter Marshall" <peter.marshall(a)ohiocoatingscompany.com> wrote in message news:OIkr$NsvKHA.5036(a)TK2MSFTNGP02.phx.gbl... > I'm looking for a simple way to check that the text entered into a text > box contains a slash at the end. I'm assuming VBA that executes On_Exit. > > -- > > Peter Marshall > Manager Information Services > Ohio Coatings Company >
From: Stefan Hoffmann on 8 Mar 2010 08:45 hi Peter, On 08.03.2010 14:30, Peter Marshall wrote: > I'm looking for a simple way to check that the text entered into a text box > contains a slash at the end. I'm assuming VBA that executes On_Exit. You may use a input mask or use this in your event: Const COLOR_LIGHTBLUE As Long = 15713933 Const COLOR_WHITE As Long = 16777215 Dim length As Long length = Len(Trim(Nz(txtYourControl.Value, ""))) If (length > 0) And _ (Mid(txtYourControl.Value, length, 1) <> "-") Then txtYourControl.BackColor = COLOR_LIGHTBLUE Else txtYourControl.BackColor = COLOR_WHITE End If btw, I would use the On Change event. mfG --> stefan <--
|
Next
|
Last
Pages: 1 2 Prev: Geting travel distance from a map - add-in Next: SELECT FROM Query name |