Searching records

L

learningMikey

Hi All... I have a very simple problem. On my main screen I have a Search
button. Once a user clicks on the a sub-form is visible with one combo box
(customer name) and text box (customer unique ID). From the combo user can
type the name of the customer and once they select the name it automatically
populates text box with that customer unique ID. On the bottom I have a
button called view. Once a user clicks on the view I want to close the main
form and open the client details form with that particular record. I am able
to open the record but unable to close the main screen. Below is my code for
click event on view button.


Dim strSQL
strSQL = "SELECT tblClient.* FROM tblClient WHERE
(((tblClient.tblClient_CID)=[Forms]![frmMain]![frmSUBClientSearch]![tblClient_CID]));"
DoCmd.OpenForm "frmMainClient", acNormal, strSQL, , acFormEdit
Docmd.close ----> By putting here it doesn't close the main screen. In fact
it closes the client detail screen.

Thanks for you help.
 
Top