I have a list box on a form. There are 2 options: Name and Number. Name is the default. When I select Name I get a two column return and that works great. I select Number and that works great.. except, I need the ColumnWidths of the Number option to be reversed.
Example: Name = 4.0;0.75;0 (which means I have a wide 1st column and a narrow 2nd column.)
For Number I need to reverse this to: 0.75;4.0;0. Whereby I would have a narrow 1st column and a wide 2nd column.
I have searched for SetFieldProperty but have not been able to implement it. Here are my two modules:
Private Sub Sort_AfterUpDate()
If (Sort = 2) Then
lstForm.RowSource = "qry_FormsByNumber"
Else
lstForm.RowSource = "qry_FormsByName"
End If
lstForm.Requery
End Sub
Private Sub CreateNewForm()
Dim FormName, value
FormName = lstForm
If FormName & "a" <> "a" Then
DoCmd.OpenForm lstForm
Else
MsgBox "Choose a Form from the list you wish to create", 0, "Choose Form"
GoTo Exit_CreateNewForm
End If
CloseMe
Forms(FormName).SetFocus
CurrentFileName = "a"
Forms(FormName).Tag = "a"
Application.MenuBar = "mnu_Application"
DoCmd.Maximize
Exit_CreateNewForm:
End Sub
********************
It would seem to me that the property setting would go after the line: DoCmd.OpenForm lstForm
My ListBox properties are:
ColumnWidth: 4.5";0.75";0"
BoundColumn: 3
ColumnHead: No
ColumnCount: 3
It would seem if I had a module with the properties I could do away with the listbox properties.
Any insight would be apprecitated!
Kelly
Example: Name = 4.0;0.75;0 (which means I have a wide 1st column and a narrow 2nd column.)
For Number I need to reverse this to: 0.75;4.0;0. Whereby I would have a narrow 1st column and a wide 2nd column.
I have searched for SetFieldProperty but have not been able to implement it. Here are my two modules:
Private Sub Sort_AfterUpDate()
If (Sort = 2) Then
lstForm.RowSource = "qry_FormsByNumber"
Else
lstForm.RowSource = "qry_FormsByName"
End If
lstForm.Requery
End Sub
Private Sub CreateNewForm()
Dim FormName, value
FormName = lstForm
If FormName & "a" <> "a" Then
DoCmd.OpenForm lstForm
Else
MsgBox "Choose a Form from the list you wish to create", 0, "Choose Form"
GoTo Exit_CreateNewForm
End If
CloseMe
Forms(FormName).SetFocus
CurrentFileName = "a"
Forms(FormName).Tag = "a"
Application.MenuBar = "mnu_Application"
DoCmd.Maximize
Exit_CreateNewForm:
End Sub
********************
It would seem to me that the property setting would go after the line: DoCmd.OpenForm lstForm
My ListBox properties are:
ColumnWidth: 4.5";0.75";0"
BoundColumn: 3
ColumnHead: No
ColumnCount: 3
It would seem if I had a module with the properties I could do away with the listbox properties.
Any insight would be apprecitated!
Kelly