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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

`Trigger event based on textbox change

Status
Not open for further replies.

plcman

Programmer
Feb 17, 2001
92
GB
Hi

I have a unbound textbox (unitsonhand) where the contents are calculated based on data in a subform, this works OK.

I have now added a textbox linked to a field in a table (discontinued). I have a form that displays records with these items on it.

I want to perform a check when each record is viewed thus: if unitsonhand <1 discontinued="yes" else discotinued="no"

As the unitsonhand is calculated the onchange event isn't triggered, any ideas on how to get around this.

Regards
 
How are ya plcman . . .

For textboxes the change event doesn't work that way. Try the forms [blue]OnCurrent[/blue] event instead.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Use the Current and the BeforeUpdate events of the form.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi

Thanks for that.

I have tried both of these and it dosen't seem to work 'properly' not always giving the correct response. It seems that the it gives its response before the subform has loaded up (I think)

Just a little more info.
The application is an inventory, and the subform is basically the filtered transactions table. The unitson hand is the totalised items in and items out as you might expect.

Thanks again for the responses
 
I found something else out!

I have now got my code in the 'current' on the subform. It seems to work there unless there are a lot of transactions in the table. Also it always work when I break the code and single step it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top