[AccessD] Combo Box 'default' - Sorry for not having changed the subject in .NET thead

Patricio Galleguillos pgalleguillos at plus.cl
Mon Feb 24 05:14:01 CST 2003


Hi Group,

Thanks for the answers, Jim and Carlos Alberto. Solved my problem with
the following code:

Private Sub Form_Open(Cancel As Integer)
    Me.ccFormName.RowSource = verForms(Me.Name)     '   fill combo and
exclude this form
    Me.ccFormName.Value = Me.ccFormName.ItemData(0) '   un-blank it
End Sub

Public Function verForms(Optional ExcludedForm As String) As String
    Dim aa
    Dim aDB As Access.AllForms
    Dim aForm As Object
    
    Set aDB = Application.CurrentProject.AllForms
    aa = ""
    For Each aForm In aDB
        If Not IsMissing(ExcludedForm) Then
            If aForm.Name <> ExcludedForm Then
                aa = aa & aForm.Name & ";"
            End If
        Else
            aa = aa & aForm.Name & ";"
        End If
    Next
    verForms = aa
End Function

Saludos Cordiales,
Patricio Galleguillos

pgallegu at chilesat.net




-----Mensaje original-----
De: accessd-admin at databaseadvisors.com
[mailto:accessd-admin at databaseadvisors.com] En nombre de Patricio
Galleguillos
Enviado el: sábado, 22 de febrero de 2003 19:15
Para: accessd at databaseadvisors.com
Asunto: [AccessD] Combo Box 'default' - Sorry for not having changed the
subject in .NET thead

Dear Group

In a combo box that displays a list of values... How can I make the
default value equal to the first element in the list so as not to have a
blank when it first opens. The list of values is generated after the
form opens.

Thanks in advance

Saludos Cordiales,
Patricio Galleguillos

pgallegu at chilesat.net




_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list