Click to See Complete Forum and Search --> : If Else


Anne Smith
March 23rd, 2001, 08:31 AM
Hi There,

I'm very new at VB programming. Right now the below code will load the form even if it has been filled already. What I want to know the syntax of checking to me sure that only if the form is not filled than the form should load in the LostFocus event. If the form is already filled, the form should not load. Can someone please help.



private Sub ctlDoctorInformation_LostFocus(Index as Integer)
If ctlDoctorInformation (Index).GetChoiceValue = "Y" then
Dim myDoctorInformation as DoctorInformationServer.DoctorIndormation
set myDoctorInformation = new DoctorInformationServer.DoctorInformation
Call myDoctorInformation.LoadForm(m_NonMedicalEvidence.GetItemByKey(Trim$(Str$(Index)), nothing), _ m_iMyEvidFunctions.OptionValueToBoolean(ctlUsualPhysician(Index).GetChoiceValue), m_Language)
set myDoctorInformation = nothing
End If
End Sub





Thanks in advance!

Anne

swatirs
March 23rd, 2001, 11:40 PM
first of all avoid using the lostfocus event. Also could u elaborate more on what the ctlDoctorInfo... controls are ( what vb controls r u using). Also check what if condition evaluates to. It may be so that the value u r checking is not getting set to "Y" after the form is filled in. Hope this helps.

Anne Smith
March 27th, 2001, 10:27 AM
ctlDoctorInfo control is control that contains some more questions to ask the paient once a "Yes" answer is selected. All I need is to go into the loadform only if a "yes" has been selected and that there are no information entered in the form.