Please Help!!! What is wrong with my code?

A

Ayo

This code is not working properly. What do you think is wrong?

Private Sub cmdChangeVendor1_Click()
DoCmd.Close acForm, "Invoice by Market Reviewer", acSaveYes
DoCmd.OpenForm "Selections", acNormal
End Sub

The issue is, I have a form,form1, that has txtbox1, a subform and a
cmdbutton1. And I have another form, form2, that has a cmbbox2 and a
cmdbutton2.
What I want to do is click the cmdbutton2 and open form1 with txtbox filled
out with the value of cmbbox2.
When I click on cmdbutton2 I want to return to form1 hence,the above code
snippet. But What happens is when I click on cmdbutton2, if txtbox1 has a
value in it, the code doesn't. But if txtbox1 is empty the code works fine.
My question is, do I have to clear form2 when I close it for this to work as
expected or is there something else I need to do?

Please help.
Ayo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top