Im having 2 forms Main Form and the Sub Form.

The Sub Form on load retrieves data from the database and displays them in the text box.

I added the sub Form to the Main Form.

I have created a button in the Main Form on clicking it shud open the loaded Sub Form.

I created a instance of sub Form and used SUBFORM.SHOWDIALOG() But this just opens the sub form instead of loading the data from the database.

Is there anyway how I can load the Sub Form instead of just showing it by clicking a button on the Main Form.

I appreciate ur help in advance