• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Interconnection of Forms & Concatenation of Information

JUES

New Member
Hello dear friends, I have a small project in which I have a drop-down list in Cell I8 of Sheet8 (HOME) which contains five items: Iletrado, Primaria, Secundaria, Técnica and Superior, from which I require that when one of the those items, the Nivel Form (frmnivel) automatically appears, which is composed of the ComboBox (CombLISTA) that must show the following items: 0, 1er, 2do, 3er, 4to, 5to, 6to, 7mo, 8vo, 9no, 10mo, 11er, 12do, 13er, 14to, 15to, 16to, 17mo, 18vo, 19no, 20mo y Completa in addition to the OptionButton (OptGRADO, OptTRIMESTRE, OptSEMESTRE and OptAÑO)

Specifically, I want to know if it is possible that, by means of a macro, when choosing the items from the drop-down list in Cell I8, the following conditions are met in the Nivel Form (frmnivel):

Iletrado: the ComboBox (CombLISTA) should only show item 0 and none of the OptionButtons can be selected.
Primaria: the ComboBox (CombLIST) should only show the 1er, 2do, 3er, 4to, 5to, 6to and Completa items:
• If you choose Completa: none of the OptionButtons can be selected.
• If you choose1er, 2do, 3er, 4to, 5to, 6to, only the OptionButton can be selected: OptGRADO

Secundaria: the ComboBox (CombLISTA) should only show the 7mo, 8vo, 9no, 10mo, 11er, 12do, and Completa items:
• If you choose Completa: none of the OptionButtons can be selected.
• If you choose 7mo, 8vo, 9no, 10mo, 11er, 12do, only the OptionButton can be selected: OptGRADO

Técnica: the ComboBox (CombLISTA) should only show the 1er, 2do, 3er, 4to, 5to, 6to, 7mo, 8vo, 9no, 10mo, 11er, 12do and Completa items:
• If you choose Completa: none of the OptionButtons can be selected.
• If you choose 1er, 2do, 3er, 4to, 5to, 6to, 7mo, 8vo, 9no, 10mo, 11er, 12do, only the OptionButtons can be selected: OptTRIMESTRE, OptSEMESTRE.

Superior: the ComboBox (CombLISTA) should only show the items 1er, 2do, 3er, 4to, 5to, 6to, 7mo, 8vo, 9no, 10mo, 11er, 12do, 13er, 14to, 15to, 16to, 17mo, 18vo, 19no, 20mo and Completa:
• If you choose Completa: none of the OptionButtons can be selected.
• If you choose 1er, 2do, 3er, 4to, 5to, 6to, 7mo, 8vo, 9no, 10mo, 11er, 12do, 13er, 14to, 15to, 16to, 17mo, 18vo, 19no, 20mo, only the OptionButtons can be selected: OptQUARTER, OptSEMESTER and OptYEAR.

Once the Item has been chosen in the ComboBox and the corresponding OptionButton has been selected (in the cases that apply), the information coming from both must be concatenated separated by a space (Example: 7mo Grado) and recorded in Cell I12 of Sheet8 (HOME) by clicking on the Register Button (CmdREGISTRAR), automatically hiding the Nivel Form (frmnivel) when registering the information.

I will be very grateful for the help you can give me.

User: Prueba
Password: Prueba12345
 

Attachments

  • PRUEBA.xlsm
    61.8 KB · Views: 1
Hello Jues.

First time ever on Chandoo.org so detail question,Really appreciated.

Try this, as took some time to understand your problem statement and could able to draw some suggestion give a try.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$I$8" Then
        ShowHideNivelForm
    End If
End Sub

Sub ShowHideNivelForm()
    Dim nivelForm As Object
    Set nivelForm = Sheets("HOME").frmnivel

    'Your logic for showing/hiding Nivel Form based on the selected item in Cell I8 goes here

    'Clear previous selections in Nivel Form
    nivelForm.CombLISTA.Clear
    nivelForm.OptGRADO.Value = False
    nivelForm.OptTRIMESTRE.Value = False
    nivelForm.OptSEMESTRE.Value = False
    nivelForm.OptAÃO.Value = False
    nivelForm.OptQUARTER.Value = False
    nivelForm.OptSEMESTER.Value = False
    nivelForm.OptYEAR.Value = False

    'Your logic for populating CombLISTA and setting OptionButtons based on the selected item goes here

    'Show or hide the Nivel Form based on conditions
    If 'Your condition for showing the Nivel Form goes here' Then
        nivelForm.Show
    Else
        nivelForm.Hide
    End If
End Sub

Sub RegisterInfo()
    Dim nivelForm As Object
    Set nivelForm = Sheets("HOME").frmnivel

    'Concatenate and record information in Cell I12
    Dim info As String
    info = nivelForm.CombLISTA.Value & " " & GetSelectedOptionButton(nivelForm)
    Sheets("HOME").Range("I12").Value = info

    'Hide Nivel Form after registering information
    nivelForm.Hide
End Sub

Function GetSelectedOptionButton(nivelForm As Object) As String
    'Your logic for determining the selected OptionButton goes here
    'Return the concatenated information based on selected OptionButton
End Function
 
Dear friend Monty, thank you very much for paying attention to my concern. I know what I want to do but I don't know how to program and that is why I am so detailed in my explanation. I will review what you sent me and if there is any problem I will let you know this way.

Hello Jues.

First time ever on Chandoo.org so detail question,Really appreciated.

Try this, as took some time to understand your problem statement and could able to draw some suggestion give a try.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$I$8" Then
        ShowHideNivelForm
    End If
End Sub

Sub ShowHideNivelForm()
    Dim nivelForm As Object
    Set nivelForm = Sheets("HOME").frmnivel

    'Your logic for showing/hiding Nivel Form based on the selected item in Cell I8 goes here

    'Clear previous selections in Nivel Form
    nivelForm.CombLISTA.Clear
    nivelForm.OptGRADO.Value = False
    nivelForm.OptTRIMESTRE.Value = False
    nivelForm.OptSEMESTRE.Value = False
    nivelForm.OptAÃO.Value = False
    nivelForm.OptQUARTER.Value = False
    nivelForm.OptSEMESTER.Value = False
    nivelForm.OptYEAR.Value = False

    'Your logic for populating CombLISTA and setting OptionButtons based on the selected item goes here

    'Show or hide the Nivel Form based on conditions
    If 'Your condition for showing the Nivel Form goes here' Then
        nivelForm.Show
    Else
        nivelForm.Hide
    End If
End Sub

Sub RegisterInfo()
    Dim nivelForm As Object
    Set nivelForm = Sheets("HOME").frmnivel

    'Concatenate and record information in Cell I12
    Dim info As String
    info = nivelForm.CombLISTA.Value & " " & GetSelectedOptionButton(nivelForm)
    Sheets("HOME").Range("I12").Value = info

    'Hide Nivel Form after registering information
    nivelForm.Hide
End Sub

Function GetSelectedOptionButton(nivelForm As Object) As String
    'Your logic for determining the selected OptionButton goes here
    'Return the concatenated information based on selected OptionButton
End Function
 

JUES

As You've read about Cross-Posting from both Forum Rules
  • Cross-Posting. Generally, it is considered poor practice to cross post. That is to post the same question on several forums in the hope of getting a response quicker.
  • If you do cross-post, please put that in your post.
  • Also if you have cross-posted and get an Solution elsewhere, have the courtesy of posting the Solution here so other readers can learn from the answer also, as well as stopping people wasting their time on your answered question.
Please reread
 

[USUARIO=101046]JUES[/USUARIO]​

Como ha leído sobre publicaciones cruzadas en ambas reglas del foro
  • Publicación cruzada. Generalmente, se considera una mala práctica al cruzar publicaciones. Se trata de publicar la misma pregunta en varios foros con la esperanza de obtener una respuesta más rápida.
  • Si realiza publicaciones cruzadas, póngalas en su publicación.
  • Además, si realizó publicaciones cruzadas y obtuvo una solución en otro lugar, tenga la cortesía de publicar la solución aquí para que otros lectores también puedan aprender de la respuesta, además de evitar que las personas pierdan el tiempo con su pregunta respondida.
Por favor vuelve a leer
https://chandoo.org/forum/threads/site-rules-new-users-please-read.294/
Saludos amigos Monty,
AlanSidman y Vlent espero que estén bien.

De hecho, si publica la misma pregunta en otro foro, no lo considera de mala educación. De igual forma consulté en el otro foro el código que me proporcionó el señor Monty ya que no entendía como hacerlo funcionar a pesar de sus instrucciones y esto porque soy novato. en programación Vba.

La intención de consultar con otro experto no era una respuesta más rápida, era que me lo explicara con más detalle ya que como le dije al Sr. Monty sé lo que quiero hacer pero no tengo las habilidades y conocimientos y no No quería molestar al Sr. Monty con preguntas básicas que los novatos como yo necesitamos aprender para alcanzar un nivel mínimo en comparación con cualquiera de ustedes que está a nivel profesional.

Prometo no volver a realizar esta práctica y si obtengo respuesta en el otro foro lo publicaré aquí para enriquecer la información de esta comunidad.
 
Last edited:

JUES

You've written something above
... with some other language than English, which normally everyone uses here.
Did You reread those Forum Rules?
... those are for everyone.
 
Back
Top