Re: Store Part of Entry

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jim Allensworth (jimNOT_at_datacentricsolutions.com)
Date: 08/19/04


Date: Thu, 19 Aug 2004 23:04:42 GMT

A string variable should be fine. It doesn't look like you have looked
at the additional code I posted yet. In that I just reference the
textbox, but a variable set to the textbox would work also. Note that
I also addressed some other issues related to user typed entries. You
might want to take a look at those.

- Jim

On Thu, 19 Aug 2004 15:38:50 -0700, "AHopper"
<anonymous@discussions.microsoft.com> wrote:

>Jim, Rick,
>I have been experimenting and have been able to populate
>the text box by declaring a variable in the After Update
>event and then replacing the number in your suggestion
>with the variable. Not certain this is the right or best
>way but it is working.
>
>Thanks
>Allan
>>-----Original Message-----
>>Rick
>>I have been able to populate the text from the unbound
>>text box after update event as you suggested. However, I
>>don't know how to make the code CLng(Right("C 108900 P
>>000516338",9)) generic.
>>I always get 516338 and am not able to scan other bar
>>codes.
>>
>>Thanks
>>Allan
>>
>>>-----Original Message-----
>>>You need to put the scanned (full) number in an unbound
>>text field. Then
>>>use the code mentioned to take the right 9 digits from
>>that field and place
>>>them into the bound field where you wish to store the
>>truncated data.
>>>
>>>Rick B
>>>
>>>
>>>"AHopper" <anonymous@discussions.microsoft.com> wrote
>in
>>message
>>>news:938f01c4862e$db6edd30$a501280a@phx.gbl...
>>>Jim,
>>>The text box is called "UniqueLabel"
>>>Do I place this code in one of the events like Before
>>>Update, After Update?
>>>
>>>This is only a sample code. The format will always be
>the
>>>same - Letter, space, 6 digits, space, letter, space, 9
>>>digits.
>>>How would I make it generic so it would apply to any
>code
>>>as it is scanned in?
>>>
>>>After thinking more about this entry form, I realized
>>>that it is possible for users to enter the number
>without
>>>scanning it. If they do and the number is 9 digits or
>>>less I want the entry to be allowed.
>>>
>>>Thank you for your support and help
>>>Allan
>>>
>>>>-----Original Message-----
>>>>Try this ..
>>>>
>>>> CLng(Right("C 108900 P 000516338",9))
>>>>
>>>> 516338
>>>>
>>>>- Jim
>>>>
>>>>On Thu, 19 Aug 2004 12:54:43 -0700, "AHopper"
>>>><anonymous@discussions.microsoft.com> wrote:
>>>>
>>>>>I posted this question as one of several questions in
>>>>>Tables & Database Design, however, I think this has
>>>more
>>>>>to do with a text box event so I am posting it here.
>>>>>
>>>>>I have a barcode with the following format:
>>>>> C 108900 P 000516338
>>>>>
>>>>>The barcode and will be scanned into a text box,
>>>however
>>>>>I only want to store the last 9 digits that are
>greater
>>>>>than 0, in this case 516338. The field that will store
>>>>>this is set to Number, Double.
>>>>>
>>>>>How can I set up the text box to only store the part
>of
>>>>>the entry I want?
>>>>>
>>>>>Thank you for your help
>>>>>
>>>>>Allan
>>>>>
>>>>>
>>>>
>>>>.
>>>>
>>>
>>>
>>>.
>>>
>>.
>>



Relevant Pages

  • Re: Prevent on Exit code when form is closed
    ... About this textbox - do you want it set up so that the user must always ... put your code in the Before Update event of the form. ... if they haven't filled in a value for txtBegHour, ... When I place the code in the On Exit event it does catch the ...
    (microsoft.public.access.formscoding)
  • Re: Unsure why VBA thinks dates entered are greater than Now() - when they are not?
    ... So I took banem2 up on his suggestion to encapsulate the textbox ... in its guessing process is to check the type of the field ... If the Format is the kind used for a date/time, ...
    (comp.databases.ms-access)
  • Re: percentage once again
    ... > Public Function MakePercent(txt As TextBox) ... > 'Usage: Set the After Update property of a text box named Text23> to: ... > and after update event is ... >>> Exit Function ...
    (microsoft.public.access.queries)
  • Re: Prevent on Exit code when form is closed
    ... any disaster happens when fixing this zero problem) ... Post back if there is still an issue with this textbox ... Before Update event does not catch the zero and fails to display the ... When I place the code in the On Exit event it does catch the ...
    (microsoft.public.access.formscoding)
  • Re: DataGrid Edit Problem
    ... after the viewstate is loaded but before the update event. ... When a row in the DataGrid is in the editable mode, ... Sub UpdateUsers(ByVal obj As Object, ... 'Address TextBox which is the 4th cell ...
    (microsoft.public.dotnet.framework.aspnet)