Displaying a field inside a Form based on a Form input

Laura1

Registered User.
Local time
Today, 07:53
Joined
Jan 4, 2013
Messages
20
Hi,
Inside my form, I would like to have an unbound text box display a field from a separate table based on a user-input into the form.

I've tried a DLOOKUP, and just putting a direct equation into the text box, but to be honest, I can't even tell from the tutorials if this is an event or a control that I'm trying to create... is it before update, after update.... where do I enter the expression builder? Is that even how I do it?

My form is collecting information on which submodule workorders are being built into a finished product workorder. The operator will enter workorder numbers several times through the completion of the form. I would like the form to read the "WORKORDER" entered, and based on that display the "PRODUCT" that is associated with that workorder from a separate query so that the operator can verify that they have typed the workorder number in correctly.

I've been able to get the product to display in the combo box, but my concern is that if the operator only types in the workorder number, (as opposed to using the drop-down menu) they will not see the product name. I would prefer to have it actively displayed, even though it is not being recorded in the table.

Any help that you can provide is greatly appreciated!!!
 
I was just reading 204126, which seems to be the same problem as I have, but I'm not sure where to enter the vba function... Does that go inside the unbound text box properties? Where does it get defined?
 
Hi, I've managed to make it work, but I've noticed that if I change my workorder entry in the form, the value in the text box does not change.

To explain, here is my syntax, which I've entered into the Control Source of the unbound text box:
=DLOOKUP("Product","QRY_WO_HYBRID","K_Workorder=SMT_Workorder")
SMT_Workorder is the value that is being entered into the form/table. If that value changes, the form is still only reflecting the data that was originally entered into the field.

Is there a way to make it update every time the value in that field changes?

Thanks so much for any help you can provide...
 
Copy the same DLOOKUP in the AfterUpdate of the text box where the Order number is entered..
 
I did try adding it to "AfterUpdate", but it still behaves the same. I added it to "On Change", "On Dbl Click", "On Enter" as well, but with no luck.

The field only updates if I close the form and then reopen it. Am I missing something?

Thanks so much for any help you can provide...
 
Try this..
Code:
=DLOOKUP("Product","QRY_WO_HYBRID","K_Workorder=" & [SM T_Workorder])
If still unable to work it out, could you please upload a screenshot / a stripped down version of your DB..
 
It seems to be working perfectly now! Thanks so much for your help!
 

Users who are viewing this thread

Back
Top Bottom