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.Rec ordset.Fin dFirst criteria
If frmStation.datLocation.Rec ordset.NoM atch = 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.datLocati on.Records et("Statio nName"))
End If
:
:
End Sub
Private Sub Search()
:
:
criteria = "GaugeNo = '" & stno & "'"
frmStation.datLocation.Rec
If frmStation.datLocation.Rec
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.datLocati
End If
:
:
End Sub
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
DOH! Never thought of that! Good point, Patrick.
ASKER
Thanks!