Ray Stantz
Registered User.
- Local time
- Today, 15:29
- Joined
- Nov 16, 2006
- Messages
- 63
Hi all,
I have an issue that really has me puzzled. In short, i have a memo field where the cursor automatically moves back to the start of the field everytime i start typing additional text into the field. I changed the cursor behavior to automatically move it to the end of the field by going to Tools/Options/Keyboard/Behavior Entering Field, thinking that would help but i still have the same issue.
Some Background: I have a legal database with a memo field called "DEFandTERMS" that houses predefined legal definitions and terms . When the user enters this memo field, a list box called "NamesList" becomes visible and displays all predefined definitions and terms for them to chose to insert into the memo field.
The code on the "DEFandTERMS" OnEnter event is:
The listbox is setup with a view of a field called "CategoryAbr". The definitions are housed in a field called "CategorySub" and there is a third field called "DefCateogry" that categogizes them from a-z. They are housed in a table called "DEFCategoryAll":
List Box
----------------------------------------------------
Name : NamesList
Control Source: DEFandTERMS
Row Source Type : Table/Query
Row Source : SELECT DEFCategoryAll.CategorySub, DEFCategoryAll.CategoryAbr FROM DEFCategoryAll;
Multi Select : Extended
Once the definitions have been selected, the user then clicks a command button to add the definitions to the memo field.
Using this code:
I also setup an unbound memo field called "DEFCategory" to be a brief catch all for definitions already housed in the "DEFandTERMS" memo field and any fromt he list box that the user chooses to add later. It has no relation to the the field in the table that the listbox is pulling from.
Long story... but i went through several designs before finding this one that semi-works. Any help is greatly appreciated.
Ray
I have an issue that really has me puzzled. In short, i have a memo field where the cursor automatically moves back to the start of the field everytime i start typing additional text into the field. I changed the cursor behavior to automatically move it to the end of the field by going to Tools/Options/Keyboard/Behavior Entering Field, thinking that would help but i still have the same issue.
Some Background: I have a legal database with a memo field called "DEFandTERMS" that houses predefined legal definitions and terms . When the user enters this memo field, a list box called "NamesList" becomes visible and displays all predefined definitions and terms for them to chose to insert into the memo field.
The code on the "DEFandTERMS" OnEnter event is:
Code:
Private Sub DEFandTERMS_Enter()
If MsgBox("Do you want to add predefined definitions?" & _
vbCrLf & vbCrLf & "Would you like to see them now?", _
vbYesNo, "Terms and Definitions") = vbYes Then
Me.NamesList.Visible = True
Me.testmultiselect.Visible = True
Me.Box435.Visible = True
Me.Label434.Visible = True
Me.List436_Label.Visible = True
Me.DEFCategory.Value = Null
Me.DEFCategory.Value = Me.DEFandTERMS.Value
Me.testmultiselect.SetFocus
End If
End Sub
The listbox is setup with a view of a field called "CategoryAbr". The definitions are housed in a field called "CategorySub" and there is a third field called "DefCateogry" that categogizes them from a-z. They are housed in a table called "DEFCategoryAll":
List Box
----------------------------------------------------
Name : NamesList
Control Source: DEFandTERMS
Row Source Type : Table/Query
Row Source : SELECT DEFCategoryAll.CategorySub, DEFCategoryAll.CategoryAbr FROM DEFCategoryAll;
Multi Select : Extended
Code:
no event procedures on listbox
Once the definitions have been selected, the user then clicks a command button to add the definitions to the memo field.
Using this code:
Code:
Private Sub testmultiselect_Click()
Dim oItem As Variant
Dim sTemp As String
Dim iCount As Integer
iCount = 0
If Me!NamesList.ItemsSelected.Count <> 0 Then
For Each oItem In Me!NamesList.ItemsSelected
If iCount = 0 Then
sTemp = DEFCategory.Value & sTemp & vbCrLf & Me!NamesList.ItemData(oItem) & vbCrLf
iCount = iCount + 1
Else
sTemp = DEFCategory.Value & vbCrLf & sTemp & vbCrLf & Me!NamesList.ItemData(oItem) & vbCrLf
iCount = iCount + 1
End If
Next oItem
Else
MsgBox "Nothing was selected from the list", vbInformation
Exit Sub
End If
Me!DEFandTERMS.Value = Trim(sTemp)
Me.DEFCategory.Value = Null
End Sub
I also setup an unbound memo field called "DEFCategory" to be a brief catch all for definitions already housed in the "DEFandTERMS" memo field and any fromt he list box that the user chooses to add later. It has no relation to the the field in the table that the listbox is pulling from.

Ray