non riesco proprio a capire allora questo è il codice che ho nel form3:
codice:
Set mydata = OpenDatabase(App.Path + "\" + "realagenzia.mdb")
Set myrecord = mydata.OpenRecordset("agenzia")
With myrecord
.AddNew
!agenzia = Trim(text1.Text)
!indirizzo = Trim(Text2.Text)
!prov = Trim(Text4.Text)
!citta = Trim(Text3.Text)
!cap = Trim(Text5.Text)
!sito = Trim(Text6.Text)
!mail = Trim(Text7.Text)
!telefono = Trim(Text8.Text)
!cellulare = Trim(Text9.Text)
!fax = Trim(Text10.Text)
.Update
End With
text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Text7.Enabled = False
Text8.Enabled = False
Text9.Enabled = False
Text10.Enabled = False
Command9.Enabled = True
MsgBox "Dati Agenzia Inseriti Correttamente"
Load Form2
Form2.Show
Unload Form3
End Sub
e questo nel form 4 scusate non era il due.
codice:
Private Sub Command7_Click()
Set mydata = OpenDatabase(App.Path + "\" + "realagenzia.mdb")
Set myrecord = mydata.OpenRecordset("agenzia")
With myrecord
myrecord.Edit
!agenzia = Trim(text1.Text)
!indirizzo = Trim(Text2.Text)
!prov = Trim(Text4.Text)
!citta = Trim(Text3.Text)
!cap = Trim(Text5.Text)
!sito = Trim(Text6.Text)
!mail = Trim(Text7.Text)
!telefono = Trim(Text8.Text)
!cellulare = Trim(Text9.Text)
!fax = Trim(Text10.Text)
.Update
End With
text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Text7.Enabled = False
Text8.Enabled = False
Text9.Enabled = False
Text10.Enabled = False
Command9.Enabled = True
MsgBox "Dati Agenzia Modificati Correttamente"
Load Form2
Form2.Show
Unload Form4
End Sub
Qualè il problema?
la if che ho scritto prima si trova nel form1 e fa riferimento al 3
grazie a tutti