Bonjour,
Lorsque j'essaie de modifier des renseignements sur une personne, je reçois le message suivant: Run-time error "381" Invalid index des propriétés de tableau.
Que dois-je faire?
Merci!
Error:
.Fields!TipPersoana = 0 + Combo1.ItemData(Combo1.ListIndex)
Private Sub modifica_Click()
If Combo1.Text = "" Then
MsgBox "Nu ati ales tipul persoanei [Tip Client]!", vbInformation + vbOKOnly, "Err"
Combo1.SetFocus
ElseIf nume.Text = "" Then
MsgBox "Nu ati completat numele clientului!", vbInformation + vbOKOnly, "Err"
nume.SetFocus
ElseIf prenume.Text = "" Then
MsgBox "Nu ati completat prenumele clientului [prenume]!", vbInformation + vbOKOnly, "Erreur"
prenume.SetFocus
ElseIf cnpcui = "" Then
MsgBox "Nu ati completat CNPul sau Codul Fiscal [CNP/CUI]!", vbInformation + vbOKOnly, "Erreur"
cnpcui.SetFocus
ElseIf serie = "" Then
MsgBox "Nu ati completat seria BI/CI [SerieBI/CI]!", vbInformation + vbOKOnly, "Erreur"
serie.SetFocus
ElseIf adresa.Text = "" Then
MsgBox "Nu ati completat adresa [Adresa]!", vbInformation + vbOKOnly, "Erreur"
adresa.SetFocus
ElseIf Combo2.Text = "" Then
MsgBox "Nu ati completat localitatea [Localitate]!", vbInformation + vbOKOnly, "Erreur"
Combo2.SetFocus
ElseIf Combo3.Text = "" Then
MsgBox "Nu ati completat judetul [Judet]!", vbInformation + vbOKOnly, "Erreur"
Combo3.SetFocus
ElseIf telefon.Text = "" Then
MsgBox "Nu ati completat numarul de telefon [Telefon]!", vbInformation + vbOKOnly, "Erreur"
telefon.SetFocus
Exit Sub
Else
mobjrec.SQL = "select * from CLIENTI where IDPersoana=" & CodeClient.Text
mobjrec.RSOpen
With rst
.Fields!TipPersoana = 0 + Combo1.ItemData(Combo1.ListIndex)
.Fields!firma = "" & firma.Text
' .Fields!peisaje = pic
.Fields!nume = nume.Text
.Fields!prenume = prenume.Text
.Fields!adresa = adresa.Text
.Fields!localitate = 0 + Combo2.ItemData(Combo2.ListIndex)
.Fields!Judet = 0 + Combo3.ItemData(Combo3.ListIndex)
.Fields!telefon = telefon.Text
.Fields!fax = "" & fax.Text
.Fields!CNP_CUI = cnpcui.Text
.Fields!SerieBI = "" & serie.Text
.Fields!banca = 0 + Combo4.ItemData(Combo4.ListIndex)
.Fields!ContBancar = "" & cont.Text
.Fields![E-mail] = "" & email.Text
.Update
End With
mobjrec.Class_Terminate
Combo1 = ""
Combo2 = ""
Combo3 = ""
Combo4 = ""
firma.Text = ""
nume.Text = ""
prenume.Text = ""
adresa.Text = ""
telefon.Text = ""
fax.Text = ""
cnpcui.Text = ""
serie.Text = ""
cont.Text = ""
email.Text = ""
MsgBox "Informatiile despre client au fost modificate!"
Call LoadFlexGrid
End If
End Sub
Afficher la suite