CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: If Else

  1. #1
    Join Date
    Mar 2001
    Posts
    7

    If Else

    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




  2. #2
    Join Date
    Dec 2000
    Location
    India
    Posts
    25

    Re: If Else

    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.


  3. #3
    Join Date
    Mar 2001
    Posts
    7

    Re: If Else

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured