Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No data in unbound text box 2

Status
Not open for further replies.

PaulCooper

Programmer
Jul 12, 2005
26
GB
I'm using (trying to!) an unbounded text box to drive a filter on a report.

Reports![rptPOI].Filter = strSQL where strSQL is the value in the text box plus a *

Entering data in the text box triggers the on_change event (which drives the filter change code) but there is no value to play with.

e.g. MsgBox Filter.Value & ":" & Filter.OldValue & ":" & Filter.BeforeUpdate

gives "::"

The result I am trying to achieve

User enters Filter is
B B*
Ba Ba*
Ban Ban*
Band Band* etc

Why can't I see the value of the unbound text box?

Regards Paul
 
Does the filter property of the report work after it's opened?

Anyway, to get the content of the control in the on change event, investigate the .Text property, not the .Value property

Roy-Vidar
 
Why not using the AfterUpdate event of the control instead of the Current one ?
MsgBox "Like " & Me!txtFilter.Value & "*"

BTW, don't give a control the same name as a form's property !

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks guys ~ that was quick.

Roy ~ yours is the key ~ I'm also using combo boxes and they use .value ~ I simply wrapped it all in one i.e.
Code:
For intCounter = 1 To 3
       If Me("Filter" & intCounter) <> "" Then
         strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " & " like " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & " And "
       End If
     Next
Where the three input boxed are called Filter1, Filter2 and Filter3 (and the tags hold the field names I want to filter on). .text does hold the changing inpout so I can crack it from here.
___________________

PHV; Thanks also for your comments. Re "don't give a control the same name as a form's property " ~ I simplified the question from the actual code, but your right, I simplified it too far and looked a muppet ~ thanks for the feedback.

Regards
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top