[AccessD] I just gotta vent

Jim Lawrence accessd at shaw.ca
Fri Dec 13 19:29:48 CST 2013


Hi John:

Use to create a seed record to handle such problems and then delete it...it was a little over the top but it seemed to do the trick.

Jim

----- Original Message -----
From: "John Colby" <jwcolby at gmail.com>
To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com>
Sent: Friday, December 13, 2013 7:24:40 AM
Subject: Re: [AccessD] I just gotta vent

The event doesn't matter.  the Text property is not available.

On 12/13/2013 10:22 AM, Arthur Fuller wrote:
> John,
>
> I seem to recall doing almost exactly this (right down to the >=3 part) but
> it was years ago so I may be foggy on how I implemented it. I think that I
> used KeyDown not the other events.
>
> Arthur
>
>
> On Fri, Dec 13, 2013 at 10:16 AM, John Colby <jwcolby at gmail.com> wrote:
>
>> The value property isn't updated until you LEAVE the control.
>>
>> I am trying to :
>> 1) accept user input key by key.  ONLY the text property displays what the
>> user is typing in AS THEY TYPE.
>> 2) if the total length is >=3 then start using that in a "like" statement
>> to pull records and display in the form
>> 3) if the length ever is less than three blank the form (if it has
>> anything displayed)
>> 4) This is kinda sorta the same functionality of a combo box except I want
>> to pull a recordset into the form
>>
>> The users want to be able to get sets of records "starting with".
>>
>> This isn't rocket science, in fact it is trivial IF there is at least one
>> record in the form, because then the whole thing just works.  As soon as
>> the form goes blank this "the control does not have the focus" bug bites.
>>   Of course the control has the focus, I AM TYPING IN IT.
>>
>> So my "search form" is just a control on the edit form.
>>
>>
>> On 12/13/2013 10:06 AM, Dan Waters wrote:
>>
>>> Hi John,
>>>
>>>   From my distant memory, in Access the .text property has a purpose but is
>>> very temporary - I've never used it.  Try using the .Value property
>>> instead
>>> - which you don't really need to use because it's the default property
>>> anyway.  Don't use the .Text property in Access - perhaps you're thinking
>>> of
>>> programming in .Net which uses .Text to get the value of many controls on
>>> forms?
>>>
>>> With your editing form, what I would do is use the information in your
>>> search form to modify a query and then set the form's recordset to that
>>> query.  What is the mechanism you've set up for getting filtered records
>>> into your form?
>>>
>>> Dan
>>>
>>> -----Original Message-----
>>> From: accessd-bounces at databaseadvisors.com
>>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Colby
>>> Sent: Friday, December 13, 2013 8:28 AM
>>> To: Access Developers discussion and problem solving
>>> Subject: Re: [AccessD] I just gotta vent
>>>
>>>    >Not sure I follow that. As Shamil said, what are you using to determine
>>> the focus? Screen.ActiveControl?
>>>
>>> The control HAS the focus.  I am TYPING IN IT.  In the ONCHANGE event I
>>> ask
>>> for ThixCtl.text and am told "the text property is only available if the
>>> control has the focus"
>>>
>>> EXCUSE ME?
>>>
>>> How can the OnChange be firing if the control does not have the focus.
>>>
>>> "By design" means that we have pretty toolbars to design and haven't got
>>> time to fix bugs that have been around for TEN YEARS.
>>>
>>>    > Don't get that. I use unbound controls all the time for searches.
>>>
>>> I don't doubt that.  What you DON'T do is use the .text property to do it
>>> because "the control doesn't have the focus".  Even though I am TYPING IN
>>> IT.
>>>
>>> BUG folks.
>>>
>>> Understand that this works just fine IF the (bound) form had a recordset
>>> displaying something.  But think about it.  This is an EDIT form.  There
>>> should not be a new record, this is for editing existing records.  The
>>> user
>>> is not allowed to enter new records. There should not be "some fake record
>>> just to allow this to work". The form should be blank and I should be able
>>> to do exactly what I am doing in order to select some value to go get
>>> existing records.
>>>
>>> jwc
>>>
>>> On 12/13/2013 8:38 AM, Jim Dettman wrote:
>>>
>>>> <<1)  The text box CAN ACCEPT the focus but Access refuses to believe
>>>> that it has the focus IF there is no data in the form.>>
>>>>
>>>> Not sure I follow that.  As Shamil said, what are you using to
>>>> determine the focus?  Screen.ActiveControl?
>>>>
>>>> <<2) TxtBox.Text is not available unless the control has the focus.>>
>>>>
>>>>     That would be correct.   .Oldvalue is the record prior to editing,
>>>>
>>> .Value
>>>
>>>> is the current value or the control, and .text is the keystroke buffer
>>>> before it has been committed to the control.
>>>>
>>>> <<3) ONLY txtbox.Text has the actual value in the control for each
>>>> character typed in.  TxtBox.Value is only updated when the control
>>>> loses the focus.>>
>>>>
>>>>     Correct.
>>>>
>>>> <<4) So at least one record has to be displayed in the form BEFORE the
>>>> search can be used.>>
>>>>
>>>>     Don't get that.  I use unbound controls all the time for searches.
>>>>
>>>> Jim.
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: accessd-bounces at databaseadvisors.com
>>>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Colby
>>>> Sent: Thursday, December 12, 2013 02:44 PM
>>>> To: accessd at databaseadvisors.com
>>>> Subject: [AccessD] I just gotta vent
>>>>
>>>> Trying to do some search kind of stuff using a text box to allow a
>>>> user <<snip>>
>>>>
>>>>   --
>>> AccessD mailing list
>>> AccessD at databaseadvisors.com
>>> http://databaseadvisors.com/mailman/listinfo/accessd
>>> Website: http://www.databaseadvisors.com
>>>
>>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>
>

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list