1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

VB 6 (subform & option button question)

Discussion in 'Software Development' started by Helen Eyob, Sep 10, 2004.

Thread Status:
Not open for further replies.
  1. Helen Eyob

    Helen Eyob Thread Starter

    Joined:
    Jul 26, 2004
    Messages:
    11
    Hi,

    There is a form, which has different sub-forms on it. The function below loads these different sub-forms when a user selects the sub-form names from the menu. It works perfectly. What I want in addition to loading the selected sub-form is, to select an option button depending on the sub-form selected. But now, all it does is select the first option button for all the sub-forms. I’ve tried “If statement”, “Case Select”, “ISLoaded”, and “Visible” methods none works… Please advise?

    Function CheckBoxUpdate(DISCIPLINES)
    On Error Resume Next

    Forms!DIF.AllowEdits = True
    Forms!DIF![EVALUATION CHECK BOXES].SourceObject = DISCIPLINES & " EVALUATION CHECK BOXES"
    Forms!DIF![IMPACT CHECK BOXES].SourceObject = DISCIPLINES & " IMPACT CHECK BOXES"
    Forms!DIF![ASCENT Signature].SourceObject = DISCIPLINES & " Signature"

    '***New lines of code start here
    Forms!DIF![EVALUATION Signature].SourceObject = DISCIPLINES & " Signature"
    Forms!DIF![Status] = 1 'option button value
    Forms!DIF![CHANGE Signature].SourceObject = DISCIPLINES & " Signature"
    Forms!DIF![Status] = 2 ' option button value
    '***end here


    Forms!DIF![DisciplineSource].Visible = True
    Forms!DIF![DisciplineSource].SetFocus
    Forms!DIF![DisciplineSource].Text = DISCIPLINES
    'MsgBox "DIF# is: " & testing & " & discpline is: " & DISCIPLINES
    Forms!DIF![DIF Number].SetFocus
    Forms!DIF![DisciplineSource].Visible = False
    Forms!DIF.AllowEdits = False
    'DoCmd.Save acForm, "DIF"

    '**** test below ****


    ‘If Forms!DIF![EVALUATION Signature].SourceObject = DISCIPLINES & " Signature" Then
    ‘If Forms!DIF![EVALUATION Signature].Visible Then
    If Forms!DIF![EVALUATION Signature].IsLoaded = True Then
    Forms!DIF![Status] = 1

    'ElseIf Forms!DIF![CHANGE Signature].SourceObject = DISCIPLINES & " Signature" Then
    'ElseIf Forms!DIF![CHANGE Signature].Visible Then
    ElseIf Forms!DIF![CHANGE Signature].IsLoaded = True Then
    Forms!DIF![Status] = 2

    End If



    End Function
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/272439

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice