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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
All Courses

From novice to tech pro — start learning today.