Not sure why it wouldn't work for you but let me walk you
thru how it works in my app.
I've created a form, added a text box for input, a command
button and a list box. I opened the Properties sheet for
the command button, selected the 'On Click' event then
selected "Code Builder" after hitting the button with
the '...' to the right of 'On Click' event field.
This then opens up the VBA editor with the cursor sitting
within the 'Sub' procedure for 'Click'. Add the code from
my previous post, making sure the lines break where they
should for an 'If..Then..End If' condition. Save.
Return to the form, and select 'View' mode. Type in any
text in the Text box, click the 'Add' button you created
and watch the text be added to the List box.
I have used this code in several apps, if it's giving you
problems check for some basic syntax errors and try again.
Sherrie