Query result in textbox

Stefan.Kauw

Registered User.
Local time
Today, 22:57
Joined
May 31, 2018
Messages
24
Query result in textbox after changed

Howdy!

I have, i guess, a small problem with refreshing/requery a form when a value is changed. This is the situation:

I have a form which where a processoperator can choose a batchnumber.
Based on that batchnumber it should run two queries to obtain two types of information:
"Behandelbeurt" which represents the state of a batch
"Norm" which represents the amount of product that should be added.

The "Behandelbeurt" should be found when changing the batchnumber. The "Norm" should be found when the behandelbeurt is available.
When running the queries and DLookups seperately everything works but when combining those it doesnt do anything.

Only when i'm using tab a couple of times through the whole form the DLookups suddenly gets filled...

So somehow it DOES trigger/activate the dlookup but not when i needed to.

Goal:
When the batchnumber ("Partijnummer") is changed, the "Behandelbeurt" and "Norm" queries should be run.
 

Attachments

  • form.png
    form.png
    14.3 KB · Views: 77
  • form_afterchange.png
    form_afterchange.png
    6.4 KB · Views: 75
  • form_aftertab.png
    form_aftertab.png
    6.1 KB · Views: 71
  • onchange_action.png
    onchange_action.png
    1 KB · Views: 66
  • onchange_code.png
    onchange_code.png
    11.6 KB · Views: 71
Last edited:
Not a lot to go on here, but my guess based on the symptoms.
Only when i'm using tab a couple of times through the whole form the DLookups suddenly gets filled...
May need to commit the values from the form to the table.
Before running the code add
me.dirty = false
this will commit the form values to the tables.
I would not use a change event but an after update. Change happens on each key stroke.
 

Users who are viewing this thread

Back
Top Bottom