Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi

Another approach by the group:

Sub PysAfficher

dim oDoc as object, oForm as object, oCurrent as object
dim oValues()

oDoc = thiscomponent                                        
oForm = oDoc.drawpage.getforms().getbyname("MainForm")      
oForm.getGroupByName("RadioGroup1", oValues())              

for each oCurrent in oValues()                              
    if oCurrent.state = 1 then                              
        msgbox oCurrent.label & " : " & oCurrent.RefValue
        exit for
    end if
next 

End Sub

Regards

Hi

Another approach by the group:

Sub PysAfficher

dim oDoc as object, oForm as object, oCurrent as object
dim oValues()

oDoc = thiscomponent                                        
oForm = oDoc.drawpage.getforms().getbyname("MainForm")      
oForm.getGroupByName("RadioGroup1", oValues())              

for each oCurrent in oValues()                              
    if oCurrent.state = 1 then                              
        msgbox oCurrent.label & " : " & oCurrent.RefValue
        exit for
    end if
next 

End Sub

[EDIT]

The given code was taken from an old database. In this old format, macros were stored in the forms (i.e. a Writer document ) and not in the database. I should have thought, I'm very sorry. I attach an updated example:

EtiquettesSelonRadio.odb

Regards