Link to home
Start Free TrialLog in
Avatar of suhani
suhani

asked on

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
Avatar of caraf_g
caraf_g

Perhaps because you're using data-bound controls and they're doing something to show their parent form?

if u start using controls on the forms the controls needs to be loaded which in turn loads the form and shows the form
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.
ASKER CERTIFIED SOLUTION
Avatar of PatrickVD
PatrickVD

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
DOH! Never thought of that! Good point, Patrick.
Avatar of suhani

ASKER

Thanks!