Probleemke met de code van ne maat van mij, ik vind het ook niet. Hij geeft de error uit de topic helemaal vanonder bij .addnew. een pintje voor diegene die het vind!
Private Sub NIEUW_Click()
NIEUW.Enabled = False
insch.Enabled = True
ID.Text = Data1.Recordset.RecordCount + 1
URSID.Text = ""
soort.Text = ""
merk.Text = ""
eigenaar.Text = ""
os.Text = ""
locatie.Text = ""
leverancier.Text = ""
GEBRUIKER.Text = ""
TYP.Text = ""
SERIE.Text = ""
HD.Text = ""
GEHEUGEN.Text = ""
PROCES.Text = ""
SERVICE.Text = ""
FCTDATE.Text = ""
FCTNR.Text = ""
PRIJS.Text = ""
End Sub
Private Sub insch_Click()
If soort.Text <> "" And merk.Text <> "" And locatie.Text <> "" And os.Text <> "" And eigenaar.Text <> "" And leverancier.Text <> "" Then
insch.Enabled = False
If eigenaar.Text = "URS NV" And soort.Text = "desktop" Then
URSID.Text = "URS-PC" + Str(Data2.Recordset.RecordCount + 47)
End If
If eigenaar.Text = "URS NV" And soort.Text = "laptop" Then
URSID.Text = "URS-LT" + Str(2 + Data3.Recordset.RecordCount)
End If
If eigenaar.Text = "URS NV" And soort.Text = "server" Then
URSID.Text = "NTANTW" + Str(13 + Data4.Recordset.RecordCount)
End If
If eigenaar.Text = "URS NL" And soort.Text = "desktop" Then
URSID.Text = "URSNL-PC" + Str(1 + Data5.Recordset.RecordCount)
End If
If eigenaar.Text = "URS NL" And soort.Text = "laptop" Then
URSID.Text = "URSNL-LT" + Str(1 + Data6.Recordset.RecordCount)
End If
If eigenaar.Text = "URS NL" And soort.Text = "server" Then
URSID.Text = "NTTERN" + Str(2 + Data7.Recordset.RecordCount)
End If
If eigenaar.Text = "BOFORT" And soort.Text = "desktop" Then
URSID.Text = "BOF-PC" + Str(1 + Data8.Recordset.RecordCount)
End If
If eigenaar.Text = "BOFORT" And soort.Text = "laptop" Then
URSID.Text = "BOF-LT" + Str(1 + Data9.Recordset.RecordCount)
End If
If eigenaar.Text = "BOFORT" And soort.Text = "server" Then
URSID.Text = "BOF-SER" + Str(1 + Data10.Recordset.RecordCount)
End If
Data1.Recordset.AddNew
NIEUW.Enabled = True
Else
MsgBox ("Vul eerst alle verplichte velden in!!!")
End If
End Sub
Private Sub NIEUW_Click()
NIEUW.Enabled = False
insch.Enabled = True
ID.Text = Data1.Recordset.RecordCount + 1
URSID.Text = ""
soort.Text = ""
merk.Text = ""
eigenaar.Text = ""
os.Text = ""
locatie.Text = ""
leverancier.Text = ""
GEBRUIKER.Text = ""
TYP.Text = ""
SERIE.Text = ""
HD.Text = ""
GEHEUGEN.Text = ""
PROCES.Text = ""
SERVICE.Text = ""
FCTDATE.Text = ""
FCTNR.Text = ""
PRIJS.Text = ""
End Sub
Private Sub insch_Click()
If soort.Text <> "" And merk.Text <> "" And locatie.Text <> "" And os.Text <> "" And eigenaar.Text <> "" And leverancier.Text <> "" Then
insch.Enabled = False
If eigenaar.Text = "URS NV" And soort.Text = "desktop" Then
URSID.Text = "URS-PC" + Str(Data2.Recordset.RecordCount + 47)
End If
If eigenaar.Text = "URS NV" And soort.Text = "laptop" Then
URSID.Text = "URS-LT" + Str(2 + Data3.Recordset.RecordCount)
End If
If eigenaar.Text = "URS NV" And soort.Text = "server" Then
URSID.Text = "NTANTW" + Str(13 + Data4.Recordset.RecordCount)
End If
If eigenaar.Text = "URS NL" And soort.Text = "desktop" Then
URSID.Text = "URSNL-PC" + Str(1 + Data5.Recordset.RecordCount)
End If
If eigenaar.Text = "URS NL" And soort.Text = "laptop" Then
URSID.Text = "URSNL-LT" + Str(1 + Data6.Recordset.RecordCount)
End If
If eigenaar.Text = "URS NL" And soort.Text = "server" Then
URSID.Text = "NTTERN" + Str(2 + Data7.Recordset.RecordCount)
End If
If eigenaar.Text = "BOFORT" And soort.Text = "desktop" Then
URSID.Text = "BOF-PC" + Str(1 + Data8.Recordset.RecordCount)
End If
If eigenaar.Text = "BOFORT" And soort.Text = "laptop" Then
URSID.Text = "BOF-LT" + Str(1 + Data9.Recordset.RecordCount)
End If
If eigenaar.Text = "BOFORT" And soort.Text = "server" Then
URSID.Text = "BOF-SER" + Str(1 + Data10.Recordset.RecordCount)
End If
Data1.Recordset.AddNew
NIEUW.Enabled = True
Else
MsgBox ("Vul eerst alle verplichte velden in!!!")
End If
End Sub