Obtaining textbox value in change event handler

前端 未结 6 737
攒了一身酷
攒了一身酷 2021-01-13 04:10

I\'ve written a form that performs queries asynchronously as text is typed into a textbox, however I somewhat arbitrarily seem to get the following error th

6条回答
  •  清酒与你
    2021-01-13 04:32

    I know this is an old thread but it's the first I found when I had the same problem. None of the answers helped except Kaganar's own solution, which pointed me in the right direction. I'm guessing the reason people had trouble reproducing the error is there are some important details missing from Kaganar's description:

    1. The Textbox was in the form header (or footer).
    2. The form did not allow additions.

    Because I believe the full answer is...

    The Text property of any control is inaccessible when the form has a record source with no records to edit

    I think there is part of Access that does not realise the textbox exists :) To understand how that might come about...

    • Put the unbound TextBox in the detail of the form
    • Do not allow additions
    • Set the recordsource to return no records
    • Open the form.

    Hey presto! No Textbox.

    Return a record, or allow additions, or delete the recordsource, et Voila! There is your Textbox with it's Text.

提交回复
热议问题