Problems closing form
I have two forms open, one of them is effectively the master form and the other a child form. It sort of acts like a sub form but is a form in its own right.
The master form has five buttons each of which opens a separate child form with (differnet) data linking directly to the record in the master form. Each of the child forms has been sized to fit into the same (cleared) space on the master form.
There is no problem when there is matching data for the child form. You simply hit the "close form" button and the child form closes leaving you back with the master form exactly as it was.
However, when there is no matching data for the child form you simply get a blank space on the screen without the "close form" button, and so are stumped.
I thought I had got the answer by putting the following code in the OnOpen event.
Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "Sorry, there are no entries for this record", vbInformation, "No Records Found"
For some reason which I do not understand this does close the child form as expected but it has the unwanted effect of also resizing the master form.
I cannot for the life of me work out what is happening, does anyone else have an idea.
It is critical for the smooth running of the application that the master form is not resized but stays exactly as is.
Any help would be greatly appreciated.
Thanks in advance