Skip to main content

AccessTr.neT


Metni Sayı Ve Karakter Kısıtına Göre Parçalara Ayırma

Metni Sayı Ve Karakter Kısıtına Göre Parçalara Ayırma

#5
dilerim işinize yarar
sonuç doğru gibi geldi ama siz yine de test edin)
Dim txtGec, txtGec2 As String
Dim BytSnr As Byte

txtGec = Me.urun_tanim
Me.tanim1 = ""
Me.tanim2 = ""
Me.tanim3 = ""

For x = 1 To 3
if x=3 then
Controls("tanim" & x).Value = left(txtGec,80)
exit for
end if
txtGec2 = Left(txtGec, 81)
If Len(txtGec2) < 81 Then
    Controls("tanim" & x).Value = txtGec2
    Exit For
End If
BytSnr = InStrRev(txtGec2, "/")
Controls("tanim" & x).Value = Left(txtGec, BytSnr - 1)
txtGec = Mid(txtGec, BytSnr + 1)
Next x
yada
Dim x, y As Byte
Dim MetBol() As String
Dim txtGec, txtMetBol, txtMetBol2 As String
Me.tanim1 = ""
Me.tanim2 = ""
Me.tanim3 = ""
txtMetBol2 = Me.urun_tanim

For y = 1 To 3
    If Len(txtMetBol2) < 80 Then
        Controls("tanim" & y).Value = txtMetBol2
        Exit For
    End If
MetBol = Split(txtMetBol2, "/")
txtMetBol = MetBol(0)
  
   For x = 1 To UBound(MetBol)
        txtGec = txtMetBol
        txtMetBol = txtMetBol & "/" & MetBol(x)
        Controls("tanim" & y).Value = txtMetBol
        If Len(txtMetBol) > 80 Then
            Controls("tanim" & y).Value = txtGec
            txtMetBol2 = Mid(txtMetBol2, Len(txtGec) + 2)
            Exit For
        End If
    Next x
Next y
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Metni Sayı Ve Karakter Kısıtına Göre Parçalara Ayırma - Yazar: berduş - 15/10/2019, 00:23
Task