Private Sub Form_Load()
On Error GoTo EHTLR
'Set TDBList1.RowSource = Adodc1.Recordset
Me.TDBList1.Column(16).Visible = False
Me.TDBList1.Column(2).Style.Font.Bold = True
Me.TDBList1.Column(2).Style.BackColor = &H80000018
Me.TDBList1.Column(2).HeadingStyle.Font.Bold = True
' TDBList1.ColumnHeaders = False
' For i = 1 To 9
' If TDBList1.Columns(i + 2).Text = "IndexKey0" & i Then TDBList1.Columns(i + 2).Text = ""
' Next i
' If TDBList1.Columns(12).Text = "IndexKey10" Then TDBList1.Columns(12).Text = ""
' Hiding some columns
Me.TDBList1.Column(16).Visible = False
Me.TDBList1.Column(17).Visible = False
Me.TDBList1.Column(19).Visible = False
Me.TDBList1.Column(20).Visible = False
Me.TDBList1.Column(21).Visible = False
' setting column caption and the size:
' TDBList1.Columns(0).Width =
Me.TDBList1.Column(0).Caption = "eFolder"
Me.TDBList1.Column(1).Caption = "eSubFolder"
Me.TDBList1.Column(2).Width = 3000
Me.TDBList1.Column(13).Caption = "Type"
Me.TDBList1.Column(13).Width = 450
Me.TDBList1.Column(14).Width = 980
Me.TDBList1.Column(14).TextAlign = 1
Me.TDBList1.Column(15).Width = 980
Me.TDBList1.Column(15).Alignment = 1
Me.TDBList1.Column(17).Caption = "Size(Bytes)"
Me.TDBList1.Column(17).Width = 850
Me.TDBList1.Column(17).Alignment = 3
Me.TDBList1.Column(18).Width = 840
Me.TDBList1.Column(18).Alignment = 1
EHTLR:
MsgBox "Error: " & Err.Number & "--" & Err.Description, , "Form_Load"
End Sub
But I end up with a object not found error when I run it....
FROM (tblMainTitle LEFT JOIN tblDocument ON tblMainTitle.MainTitleKey = tblDocument.MainTitleKey) LEFT JOIN tbleSubFolderTable ON tblDocument.SubLevelOneKey = tbleSubFolderTable.SubLevelOneKey;
With Warm Regards,
hi Art,
make a query and assume the value of each of those checkboxes by using True or False in criteria for the query. Once you have done that, let us know what the SQL is and we can help you with the VBA to get there.
have an awesome day,
crystal
There is three checkboxes on another form called frmMain which are set when a user completes a series of actions. However those checkboxes are set will determine the rowsource of the list box on frmDocument list.
With Warm Regards,Arthur D. LorenziniIT System ManagerCheyenne River Housing AuthorityWk.(605)964-4265 Ext. 130Fax (605)964-1070
"Valar Dohaeris"
On Saturday, September 16, 2017 02:48:52 PM, crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
hi Art,
yes, the RowSource of a combobox or listbox can be created with code.
The first step would be to make a query that shows the data you want. Then copy its SQL and modify (or create) the WHERE clause with VBA and make that the RowSource.
How will this be triggered?
have an awesome day,
crystal
On 9/16/17 1:47 PM, dbalorenzini@yahoo.com [MS_Access_Professionals] wrote:
Can you create and populate a listbox control dynamically using vba?
Thank you,
Art Lorenzini
SD
Posted by: Art Lorenzini <dbalorenzini@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (6) |
Tidak ada komentar:
Posting Komentar