charly.csh
05-07-2020, 12:22 PM
Hi everyone
I hope somebody could help me with this...
I'm writing into a textbox with my code a "List of people" depending on some Checkboxes. (The name of the textbox is TeamWorktxt) and the checkboxes are WT_Quality, WT_Production, WT_Warehouse, WT_Process.
If I l click on one it adds the name of the guy responsible of the "area" and after this addition I am also using the VbCrLf to "create" an "Enter" effect... it gives the appearance into the big textbox like a "list"
The issue is when unclick on this check box an use the property REPLACE and CHR(10) or CHR(13) it deletes all the "blank" spaces and the list lose its structure. What I want is just to clean the line created or "undo" my "Enter"
I do not know if there is just a property to eliminate just a "line" and not all the blank spaces
I highly appreciate your support
My code
'****************************************
Private Sub WT_Quality_Click()
If Me.WT_Quality = -1 And Len(Me.TeamWorktxt & vbNullString) = 0 Then
Me.TeamWorktxt = DLookup("[Name]", "[TeamWork]", "[Department]= 'Quality'")
ElseIf Me.WT_Quality = -1 And Me.TeamWorktxt <> "" Then
Me.TeamWorktxt = Me.TeamWorktxt & vbCrLf & DLookup("[Name]", "[TeamWork]", "[Department]= 'Quality'")
End If
If Me.WT_Quality = 0 Then
Dim Quality As String
Quality = DLookup("[Name]", "[TeamWork]", "[Department]= 'Quality'")
'Here is my issue, I am sure if this is the best way to do this...
Me.TeamWorktxt = Replace(Me.TeamWorktxt, Quality, "")
Me.TeamWorktxt = Replace(Me.TeamWorktxt, Chr(10), "") 'Chr(10)
Me.TeamWorktxt = Replace(Me.TeamWorktxt, Chr(13), "") 'Chr(13)
End If
End Sub
I hope somebody could help me with this...
I'm writing into a textbox with my code a "List of people" depending on some Checkboxes. (The name of the textbox is TeamWorktxt) and the checkboxes are WT_Quality, WT_Production, WT_Warehouse, WT_Process.
If I l click on one it adds the name of the guy responsible of the "area" and after this addition I am also using the VbCrLf to "create" an "Enter" effect... it gives the appearance into the big textbox like a "list"
The issue is when unclick on this check box an use the property REPLACE and CHR(10) or CHR(13) it deletes all the "blank" spaces and the list lose its structure. What I want is just to clean the line created or "undo" my "Enter"
I do not know if there is just a property to eliminate just a "line" and not all the blank spaces
I highly appreciate your support
My code
'****************************************
Private Sub WT_Quality_Click()
If Me.WT_Quality = -1 And Len(Me.TeamWorktxt & vbNullString) = 0 Then
Me.TeamWorktxt = DLookup("[Name]", "[TeamWork]", "[Department]= 'Quality'")
ElseIf Me.WT_Quality = -1 And Me.TeamWorktxt <> "" Then
Me.TeamWorktxt = Me.TeamWorktxt & vbCrLf & DLookup("[Name]", "[TeamWork]", "[Department]= 'Quality'")
End If
If Me.WT_Quality = 0 Then
Dim Quality As String
Quality = DLookup("[Name]", "[TeamWork]", "[Department]= 'Quality'")
'Here is my issue, I am sure if this is the best way to do this...
Me.TeamWorktxt = Replace(Me.TeamWorktxt, Quality, "")
Me.TeamWorktxt = Replace(Me.TeamWorktxt, Chr(10), "") 'Chr(10)
Me.TeamWorktxt = Replace(Me.TeamWorktxt, Chr(13), "") 'Chr(13)
End If
End Sub