I have a form 1 which has a textbox. User adds something to this textbox and clicks on the ADD button. User is taken to form 2 and the value has been added to a listbox.

on this form 2 there is a listbox which stores values from the previous form. I also have a button on this form. I want to write code for this button so that when it is clicked...

if the 1st listbox contains x, and the 2nd listbox contains y, and the 3rd listbox contains z,


form A is displayed.

im not quite sure how this is done. i have done something like this:

If Me.ListBox1.Contains "X" and ME.listbox2.Contains "Y"
AND ME.listbox3.contains "Z" then

is this a wrong approach? or do i need to use the variables from form 1 in the code?? please help!