depending on your access version, go to your form's design view and make sure you have the controls wizard enabled. click on the combo box, add it to your form and the wizard prompt will appear. select the third option in the list "find a record on my form based on the value i selected in my combo box".... then follow the other prompts.
access will automatically enter the VBA code.