This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I encountered a bug in Microsoft Access 2010 where I would open a form in split view or datasheet view, | |
rearrange the order of columns, save the form, re-open the form and the column order would not reflect | |
the columns order I had tried to save. | |
Solution: | |
1. Open the form in datasheet view | |
2. Re-order the columns | |
3. Right-click a column header and click Unhide fields | |
4. Close the Unhide fields dialog | |
5. Save the form and re-open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' <summary> | |
''' Returns a DataTable from a database query defined by a ConnectionString. | |
''' </summary> | |
''' <param name="ConnectionString">ConnectionString to a database</param> | |
''' <param name="Sql">An SQL query</param> | |
''' <returns>DataTable</returns> | |
Private Function GetDataTable(ConnectionString As String, Sql As String) As DataTable | |
'the DataTable to return | |
Dim MyDataTable As New DataTable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @Packs AS NVARCHAR(MAX) | |
select @Packs = STUFF((SELECT DISTINCT ',' + QUOTENAME(LTRIM(RTRIM(Pack))) from basequeryTotalPupsByRegion FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'),1,1,'') | |
select @Packs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Function OpenFile() As String | |
'build and configure an OpenFileDialog | |
Dim OFD As New OpenFileDialog | |
With OFD | |
.AddExtension = True | |
.CheckFileExists = True | |
.Filter = "Excel files(.xlsx)|*.xlsx|Excel files (*.xls)|*.xls" | |
.Multiselect = False | |
.Title = "Select an workbook to open" | |
End With |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' <summary> | |
''' Returns the value of GridEX's current cell, if it exists, otherwise an empty string. | |
''' </summary> | |
''' <param name="GridEX">GridEX</param> | |
''' <param name="ColumnName">Name of GridEX cell to interrogate.</param> | |
''' <returns>String</returns> | |
Private Function GetGridEXCellValue(GridEX As GridEX, ColumnName As String) As String | |
Dim CellValue As String = "" | |
'the gridex contains a column called FilesDirectory where the project's files are stored | |
'this sub will get the currently selected row in the GridEX, identify the FilesDirectory value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Me.ItemsListView has two columns, one for the file name and one for the full file path | |
Dim FileAttributes(2) As String | |
FileAttributes(0) = FileInfo.Name | |
FileAttributes(1) = FileInfo.FullName | |
Dim ListViewItem As New ListViewItem(FileAttributes) | |
Me.ItemsListView.Items.Add(ListViewItem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For Each SpecialFolder As Environment.SpecialFolder In System.Enum.GetValues(GetType(Environment.SpecialFolder)) | |
Debug.Print(System.Environment.GetFolderPath(SpecialFolder)) | |
Next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For Each SpecialFolder As String In System.Enum.GetNames(GetType(Environment.SpecialFolder)) | |
Debug.Print(SpecialFolder) | |
Next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' <summary> | |
''' Returns a DataTable containing metadata about the structure of the submitted DataTable | |
''' </summary> | |
''' <param name="InputDataTable">DataTable to describe.</param> | |
''' <returns>DataTable</returns> | |
Public Function GetMetadataDataTable(InputDataTable As DataTable) As DataTable | |
Dim ColumnsDataTable As New DataTable("Columns") | |
'column names column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'the gridex contains a column called FilesDirectory where the project's files are stored | |
'this sub will get the currently selected row in the GridEX, identify the FilesDirectory value | |
'and attempt to open the path using a process (file explorer, most likely) | |
Try | |
'get the current row of the VS GridEX | |
If Not Me.TblVitalSignsGridEX.CurrentRow Is Nothing Then | |
Dim CurrentRow As GridEXRow = Me.TblVitalSignsGridEX.CurrentRow | |
'loop through the columns and look for the FilesDirectory columns | |
For i As Integer = 0 To CurrentRow.Cells.Count - 1 | |
If CurrentRow.Cells(i).Column.Key = "FilesDirectory" Then |
NewerOlder