Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2005

Tip: Looking for answers? Try searching our database.

set text/value property of a text box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
couch032 - 12 Oct 2005 19:29 GMT
Anyone,

I have a unbound form (frmlookup) that contains a text box (Mysearch) and a
subform (sfrmlookup).  The text box is mentioned in the subform underlying
query Criteria for MatrialName: Like "*" & [Mysearch] & "*".  When you type
in the text box it requeries the subform but only after you hit enter.  Is
there a way to make the subform requery every time something is typed in the
text box without hitting enter or losing focus? Like if someone types in 8,
it requeries and brings up every name that contians an 8 in, then a 5 is
typed in and it bring up every name with an 85 in it.

Thanks
Brendan Reynolds - 12 Oct 2005 19:52 GMT
You can try calling Requery in the Change event of the text box. This can
get tricky, though. For example, if the text box contains the single digit
'8', and the user backspaces out the '8' before typing a '7', the Change
event will fire after backspacing the '8' and before typing the '7', which
is probably not what you want. You might want to add some code to test that
the text box contains a valid value before calling Requery. Something like
...

If Len(Me!NameOfTextBox & vbNullString) > 0 Then
   If IsNumeric(Me!NameOfTextBox) Then
       Me.Requery
       'Or Me.NameOfSubFormControl.Requery, as appropriate
   End If
End If

Signature

Brendan Reynolds

> Anyone,
>
[quoted text clipped - 12 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.