[visual basic]errore
Private Sub cmdsalva_Click() Dim a As Boolean Dim ur As Integer Dim k As Integer k = txtnmatr.Text ur = LOF(1) / Len(s) a = False Get #1, 1, s While Not EOF(1) If k = s.nmatr Then a = True End If Get #1, , s Wend If a = False Then s.nmatr = txtnmatr.Text s.classe = txtclasse.Text s.cognome = txtcognome.Text s.indirizzo = txtindirizzo.Text s.eliminato = False Put #1, ur + 1, s ORDINA lstkey.Clear CARICALSTKEY Else: MsgBox ("Contatto già presente") Dim i As Control For Each i In Form2 If TypeOf i Is TextBox Then i.Text = "" End If Next txtnmatr.SetFocus End If End Sub
Risposte
Potresti essere più preciso sul tipo di errore che incontri? Che cosa dovrebbe fare il codice? Il codice non viene compilato oppure l'errore si presenta a runtime? Di che errore si tratta? Che messaggio viene stampato dal compilatore o a runtime?
Errore logico di esecuzione cioè non inserisce nulla, scusa se non sono stato preciso hai ragione.. Quando inserisco dei valori nei campi text questa funzione dovrebbe inserirmeli nel file.