Why frmStation pop out during processing

Could someone please tell me why is the frmStation pop out during the execution whereas I didn't put frmStation.Show?

Private Sub Search()
:
:

criteria = "GaugeNo = '" & stno & "'"
frmStation.datLocation.Recordset.FindFirst criteria

If frmStation.datLocation.Recordset.NoMatch = True Then
    Msg = MsgBox("Could not find station based on gauge no: " & StationNo, vbExclamation, "Error")
    ILOCATION = UCase(InputBox("Please enter station name", "Station Name", , 3000, 2400))
Else
    ILOCATION = UCase(frmStation.datLocation.Recordset("StationName"))
End If

:
:
End Sub
suhaniAsked:
Who is Participating?
 
PatrickVDConnect With a Mentor Commented:
Are you using MDIForm and child windows ???
If so, you might have forgotten to switch of the AutoShowChildren property of the MDIForm ?
0
 
caraf_gCommented:
Perhaps because you're using data-bound controls and they're doing something to show their parent form?

0
 
pinshahCommented:
if u start using controls on the forms the controls needs to be loaded which in turn loads the form and shows the form
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
caraf_gCommented:
Who's "u"?

Yes... the controls need to be loaded, but that doesn't necessarily show the form.

Try this:

Private Sub Main()

Form1.Text1.Text = "hello world"

End Sub

Form is loaded, but not shown.
0
 
caraf_gCommented:
DOH! Never thought of that! Good point, Patrick.
0
 
suhaniAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.