Textbox result

R

ryan.fitzpatrick3

I have 2 textboxes, the first textbox runs a query with the
information added, which being an item number. In the 2nd textbox I
want the description that comes up for the item number to post, if not
then a msgbox stating not an item number, is this possible? Thanks in
advance.

Ryan
 
M

Marshall Barton

I have 2 textboxes, the first textbox runs a query with the
information added, which being an item number. In the 2nd textbox I
want the description that comes up for the item number to post, if not
then a msgbox stating not an item number, is this possible? Thanks in
advance.

Use the text box's AfterUpdate event:

Me.[Descr text box] = DLookup("[descr field]", "thetable", _
"[item num field]=" & Me.[item id text box])
If IsNull(Me.[Descr text box]) Then MsgBox "No such item"
 
J

Jeanette Cunningham

A bit more info needed.
Is this a bound form and are both textboxes bound?
User types a value in 1st text box.
What is the trigger that makes the query run?
Is it an append query?
After you run the ??append query, you would need to requery the form so it
would go back to its table and get the newly added data.
Then you would need the form to display the record that was just edited.
What sort of business need lies behind this textbox query strategy?

Maybe it would be easier to make the first text box a combo and use the Not
In List event of a combo?

Jeanette Cunningham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top