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

Look Up Questions.

Status
Not open for further replies.

Tamrak

MIS
Jan 18, 2001
213
US
Hello,

I hope this is not too difficult problem. Apparently, I forgot to do something right.

I am creating two data entry forms. They came from two different tables with field Name "ticket" be a common field. This "ticket" (Ticket number) is a text field. I have a relationship established between these two tables.

The first table contains all information such as ticket, order date... etc. I created a data entry form name "Initial Order." Everything works fine.

The second table contains the "ticket" and "confirmation date" plus all other fields. I crated the form and called this form, "Confirmation Order."

What I would like to do:

1. When I enter a ticket number, (property -> afterupdate), in the "Confirmation Order" form, I would like to have the "Initial Order" Form popped up with the specific ticket number that has just been entered. This "Initial Order" form was created based on a query which has the "ticket" field sorted.

2. The "Initial Order" pop-up Form should be filtered or pointed to that ticket number as soon as the form opened. The ticket number is unique, no duplicate. This "Initial Order" pop-up form is read-only, no edit.

3. If the wrong ticket number is entered, an error message box should say, "no ticket found." It will prompt the user to re-enter the ticket (gotocontrol -> ticket) or leave the menu.

Please help. I am stuck and I could not remember how to resolve it. Thank you for your help and the reply.


Tamrak
 
to make what you describe happen you need code like

IF NZ(DLOOKUP(&quot;[TICKET]&quot;,&quot;[INITIAL ORDER]&quot;,&quot;TICKET ='&quot; & ME.TICKET &&quot;'&quot; <> 0 THEN
DOCMD.OPENFORM &quot;INITIALORDER&quot;,,,&quot;TICKET ='&quot; & ME.TICKET &&quot;'&quot;
ELSE
msgbox &quot;no number exists&quot;
end if

Another method to accomplish this would be to have the place where they type in the order number be a combobox with its source based on the initial order table. then use the not in list event to fire the no match. there is a good FAQ under the access general catagory describing this method.
 
Dear Gol4,

Thank you so much for your reply. I will try it and let you know.

One quick question, can I do the same thing in the &quot;MACROS&quot; format, instead of a VB code? Please advise. Thank you.

Tamrak
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top