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

#7
sayın @berduş son gönderdiğiniz kodlarda 3. kısımda da diğerleri gibi 80 karakter ve "/" kontrolü yapıyor, halbuki son bölümde sadece 80 karakterlik kısmı alıp gerisini kesip atması gerekiyor.
örneğin:
ürün tanımımız şu olsun: Ürün Modeli1/Model Ölçüsü/Model Opsiyonu165/Model Opsiyonu2/Model Opsiyonu3/Model Opsiyonu4/Model Opsiyonu5/Model Opsiyonu6/Model Opsiyonu7/Model Opsiyonu8/Model Opsiyonu9/Model Opsiyonu10/Model Opsiyonu11/Model Opsiyonu12/Model Opsiyonu13
gönderdiğiniz kodlara göre ;
1 kısım: Ürün Modeli1/Model Ölçüsü/Model Opsiyonu165/Model Opsiyonu2/Model Opsiyonu3
2. kısım: Model Opsiyonu4/Model Opsiyonu5/Model Opsiyonu6/Model Opsiyonu7/Model Opsiyonu8
3. kısım: Model Opsiyonu9/Model Opsiyonu10/Model Opsiyonu11/Model Opsiyonu12
olarak çıkıyor. yani son bölümde de "/" kontrolü yapıyor.
halbuki son bölüm şu şekilde yazması yeterli:Model Opsiyonu9/Model Opsiyonu10/Model Opsiyonu11/Model Opsiyonu12/Model Opsiyon.

benim 4. mesajda gönderdiğim kodlarla alakalı tespitiniz doğru, kodlarımı aşağıdaki gibi revize edince problem tam olarak çözüldü:

Dim a, b, f, g, h, i, j As String
Dim x, y, z As Integer
a = ""
g = ""
Dim c, d, e As Variant
c = Split(Me.urun_tanim, "/")

If Me.sayTanim.Value <= 80 Then
Me.tanim1 = Me.urun_tanim
Me.tanim2 = ""
Me.tanim3 = ""
ElseIf Len(Me.urun_tanim) > 80 Then
For say = LBound© To UBound©
    If say = 0 Then
        a = a + CStr(c(say))
        b = ""
    Else
        a = a + "/" + CStr(c(say))
        If say - 1 = 0 Then
        b = b + CStr(c(say - 1))
        Else
        b = b + "/" + CStr(c(say - 1))
        End If
    End If
        If (Len(a) > 80 And Len(b) <= 80) Then
            Me.tanim1 = b
        End If
Next
'2. part başlangıcı*******************************
f = Replace(Me.urun_tanim, Me.tanim1 + "/", "")
d = Split(f, "/")

If Len(f) <= 80 Then
Me.tanim2 = f
Me.tanim3 = ""
ElseIf Len(f) > 80 Then
For say = LBound(d) To UBound(d)
    If say = 0 Then
        g = g + CStr(d(say))
        h = ""
    Else
        g = g + "/" + CStr(d(say))
        If say - 1 = 0 Then
            h = h + CStr(d(say - 1))
        Else
            h = h + "/" + CStr(d(say - 1))
        End If
    End If
    If (Len(g) > 80 And Len(h) <= 80) Then
    Me.tanim2 = h
    End If
Next

'3. part başlangıcı*******************************
i = Me.tanim1 + "/" + Me.tanim2
j = Replace(Me.urun_tanim, i + "/", "")
Me.tanim3 = Left(j, 80)
End If
End If
Cevapla
#8
For x = 1 To 3 hemen altına aşağıdaki kontrolü eklesek
if x=3 then
Controls("tanim" & x).Value = left(txtGec,80)
exit for
end if
For x = 1 To 3
if x=3 then
Controls("tanim" & x).Value = left(txtGec,80)
exit for
end if
Cevapla
#9
Sonuç Mükemmel. Ellerinize ve Zihninize sağlık.
çok teşekkürler @berduş
Cevapla
#10
ÖD)
iyi çalışmalar
Cevapla

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

Yorum yapmak için üye olmanız gerekiyor

ya da
Task