Pop up form meeting text box requierment

N

Nick

I want certain forms to pop up when certain words are entered into a sub
form control text box.
Example: Where the "Employee History" form has in the "situation" contorl
text box the word from the list box "Accident", I want the "300 Form" to pop
up and when that form is completed I want the 301 Form to pop up. All three
table are linked in the Employee history table at the actionID control.
Thanks in advance.
 
D

Daniel

You're going to have to trap the changes to the control(s) in question,
evaluate them and then act accordingly. probably a case statement would work
best

Somthing like,

StrCtlVal=Me.ControlName
Select Case StrCtlVal
Case "YourCriteria"
docmd.openform "300 Form"

Case "AnotherCriteria"
docmd.openform "301"
 
J

John W. Vinson

I want certain forms to pop up when certain words are entered into a sub
form control text box.
Example: Where the "Employee History" form has in the "situation" contorl
text box the word from the list box "Accident", I want the "300 Form" to pop
up and when that form is completed I want the 301 Form to pop up. All three
table are linked in the Employee history table at the actionID control.
Thanks in advance.

Would it be satisfactory to have the 300 form pop up *after* the user has
typed all the data into the textbox? I don't think you'ld want a textbox
popping up while the user is busy typing - it might ACCIDENTally pop up when
it needn't!

If so, you can use the textbox's AfterUpdate event to check its value for the
key words. I'm not sure what you mean by 'the word from the list box
"Accident"' - is there a listbox named Accident? What "word" might it contain?
Or are you looking for the word "accident" typed into the textbox?

John W. Vinson [MVP]
 
N

Nick

I see what you mean. The list box of the "Situation" has a number of word to
select from and in that list words like "Vehicle injury accident" , "Animal
injury attack" that would open or pop up the 300 form and then the 301 form
while other words would not like safety review. I hope I have conveyed what I
am needing.
 
J

John W. Vinson

I see what you mean. The list box of the "Situation" has a number of word to
select from and in that list words like "Vehicle injury accident" , "Animal
injury attack" that would open or pop up the 300 form and then the 301 form
while other words would not like safety review. I hope I have conveyed what I
am needing.

Not really.

It sounded like you were having text typed freely into a textbox and needed to
match it to values in a listbox. Apparently not.

You can use the AfterUpdate event of the listbox to determine which value was
selected, and then open a form based on the value. But it's not clear from
this WHICH values would cause this other form to open - and I'm really queasy
about embedding the business logic in the name values anyway!

I'd be inclined to add another field to the Listbox's RowSource table
indicating which supplementary form should be opened (maybe someday there will
be one form for accidents, a different form for other medical emergencies,
....), rather than trying to parse the actual text value from the listbox.
Would that be a reasonable approach?

John W. Vinson [MVP]
 
Top