arkadaşlar selamlar. bu konu ile ilgili bir yeni konu açmıştım ancak kilitlenmiş. sanırım soru sorma yöntemimde bir hata var. o yüzden biraz daha açıklayıcı soruyorum. aşağıdaki kodlar ile veri tabanıma userform üzerindeki bilgileri kaydediyorum. userformun üzerinde bir de rapor al düğmesi var. bu düğmeye tıklayınca da yeni bir userform üzerinde listview gibi bir nesnenin açılmasını ve burada adı soyadı, puanı, okulu tercihleri gibi bir kaç bilginin listelenmesini istiyorum. ayrıca listview de alt tarafta toplam kaç kayıt olduğu da yazacak. kodlar şu şekilde. (ayrıca ilgilenen arkadaşlar için dosyayı da ekliyorum. iyi çalışmalar)
Private Sub CommandButton2_Click()
Dim bak As Range
Dim say As Integer
For Each bak In Range("A1:A" & WorksheetFunction.CountA(Range("A1:A65000")))
If bak.Value = ComboBox21.Value Then
MsgBox "Bu Kayıt numarası bulundu."
Exit Sub
End If
Next bak
For Each bak In Range("B1:B" & WorksheetFunction.CountA(Range("B1:B65000")))
If StrConv(bak.Value, vbUpperCase) = StrConv(ComboBox21.Value, vbUpperCase) Then
MsgBox "Bu isimde bir kaydınız bulundu"
Exit Sub
End If
Next bak
say = WorksheetFunction.CountA(Range("B1:B65000"))
TextBox5.Value = say
Cells(say + 1, 1).Value = TextBox5.Value
Cells(say + 1, 2).Value = ComboBox21.Value
Cells(say + 1, 3).Value = ComboBox20.Value
Cells(say + 1, 4).Value = TextBox1.Value
Cells(say + 1, 5).Value = TextBox2.Value
Cells(say + 1, 6).Value = TextBox3.Value
Cells(say + 1, 7).Value = TextBox4.Value
Cells(say + 1, 8).Value = ComboBox14.Value
Cells(say + 1, 9).Value = ComboBox1.Value
Cells(say + 1, 10).Value = ComboBox15.Value
Cells(say + 1, 11).Value = ComboBox2.Value
Cells(say + 1, 12).Value = ComboBox16.Value
Cells(say + 1, 13).Value = ComboBox3.Value
Cells(say + 1, 14).Value = ComboBox17.Value
Cells(say + 1, 15).Value = ComboBox4.Value
Cells(say + 1, 16).Value = ComboBox18.Value
Cells(say + 1, 17).Value = ComboBox5.Value
Cells(say + 1, 18).Value = ComboBox19.Value
Cells(say + 1, 19).Value = ComboBox6.Value
Cells(say + 1, 20).Value = TextBox16.Value
Cells(say + 1, 21).Value = TextBox17.Value
Cells(say + 1, 22).Value = TextBox18.Value
Cells(say + 1, 23).Value = TextBox19.Value
Cells(say + 1, 24).Value = TextBox20.Value
Cells(say + 1, 25).Value = TextBox21.Value
Cells(say + 1, 26).Value = TextBox22.Value
Cells(say + 1, 27).Value = TextBox23.Value
Cells(say + 1, 28).Value = TextBox24.Value
Cells(say + 1, 29).Value = TextBox25.Value
Cells(say + 1, 30).Value = TextBox26.Value
Cells(say + 1, 31).Value = TextBox27.Value
Cells(say + 1, 32).Value = TextBox28.Value
Workbooks("versiyon1").Save
MsgBox "Verileriniz Kaydedildi", , "KAYIT"
CommandButton3_Click
ComboBox21.RowSource = "Veri!B2:B" & say + 1
TextBox5.Value = WorksheetFunction.Count(Range("A1:A65000")) + 1
End Sub
Private Sub CommandButton2_Click()
Dim bak As Range
Dim say As Integer
For Each bak In Range("A1:A" & WorksheetFunction.CountA(Range("A1:A65000")))
If bak.Value = ComboBox21.Value Then
MsgBox "Bu Kayıt numarası bulundu."
Exit Sub
End If
Next bak
For Each bak In Range("B1:B" & WorksheetFunction.CountA(Range("B1:B65000")))
If StrConv(bak.Value, vbUpperCase) = StrConv(ComboBox21.Value, vbUpperCase) Then
MsgBox "Bu isimde bir kaydınız bulundu"
Exit Sub
End If
Next bak
say = WorksheetFunction.CountA(Range("B1:B65000"))
TextBox5.Value = say
Cells(say + 1, 1).Value = TextBox5.Value
Cells(say + 1, 2).Value = ComboBox21.Value
Cells(say + 1, 3).Value = ComboBox20.Value
Cells(say + 1, 4).Value = TextBox1.Value
Cells(say + 1, 5).Value = TextBox2.Value
Cells(say + 1, 6).Value = TextBox3.Value
Cells(say + 1, 7).Value = TextBox4.Value
Cells(say + 1, 8).Value = ComboBox14.Value
Cells(say + 1, 9).Value = ComboBox1.Value
Cells(say + 1, 10).Value = ComboBox15.Value
Cells(say + 1, 11).Value = ComboBox2.Value
Cells(say + 1, 12).Value = ComboBox16.Value
Cells(say + 1, 13).Value = ComboBox3.Value
Cells(say + 1, 14).Value = ComboBox17.Value
Cells(say + 1, 15).Value = ComboBox4.Value
Cells(say + 1, 16).Value = ComboBox18.Value
Cells(say + 1, 17).Value = ComboBox5.Value
Cells(say + 1, 18).Value = ComboBox19.Value
Cells(say + 1, 19).Value = ComboBox6.Value
Cells(say + 1, 20).Value = TextBox16.Value
Cells(say + 1, 21).Value = TextBox17.Value
Cells(say + 1, 22).Value = TextBox18.Value
Cells(say + 1, 23).Value = TextBox19.Value
Cells(say + 1, 24).Value = TextBox20.Value
Cells(say + 1, 25).Value = TextBox21.Value
Cells(say + 1, 26).Value = TextBox22.Value
Cells(say + 1, 27).Value = TextBox23.Value
Cells(say + 1, 28).Value = TextBox24.Value
Cells(say + 1, 29).Value = TextBox25.Value
Cells(say + 1, 30).Value = TextBox26.Value
Cells(say + 1, 31).Value = TextBox27.Value
Cells(say + 1, 32).Value = TextBox28.Value
Workbooks("versiyon1").Save
MsgBox "Verileriniz Kaydedildi", , "KAYIT"
CommandButton3_Click
ComboBox21.RowSource = "Veri!B2:B" & say + 1
TextBox5.Value = WorksheetFunction.Count(Range("A1:A65000")) + 1
End Sub