Hi, it worked in acces 2000, and now am using acces 2003.
Anybody any clue why the string strVoorstel would not get the value?
It just returns nothing.
here's the code:
Dim strVoorstel As String
Dim lngTel As Long
Dim strQer As String
Dim strDa As String
Dim lngNum As Long
strDa = "Referentienummer"
strQer = "tblKlachten"
lngTel = DCount(strDa, strQer, [Referentienummer])
lngNum = lngTel + 1
If lngNum < 10 Then
strVoorstel = "CC" & strJaartal & "/" & "00" & lngNum
If lngNum < 100 Then
strVoorstel = "CC" & strJaartal & "/" & "00" & lngNum
Else
strVoorstel = "CC" & strJaartal & "/" & lngNum
End If
End If
If strMacht = False Then
Knop283.Visible = False
Else
Knop283.Visible = True
End If
MsgBox strVoorstel
Me.Referentienummer.SetFocus
Referentienummer.Text = strVoorstel
Me.Productiedatum.SetFocus
Anybody any clue why the string strVoorstel would not get the value?
It just returns nothing.
here's the code:
Dim strVoorstel As String
Dim lngTel As Long
Dim strQer As String
Dim strDa As String
Dim lngNum As Long
strDa = "Referentienummer"
strQer = "tblKlachten"
lngTel = DCount(strDa, strQer, [Referentienummer])
lngNum = lngTel + 1
If lngNum < 10 Then
strVoorstel = "CC" & strJaartal & "/" & "00" & lngNum
If lngNum < 100 Then
strVoorstel = "CC" & strJaartal & "/" & "00" & lngNum
Else
strVoorstel = "CC" & strJaartal & "/" & lngNum
End If
End If
If strMacht = False Then
Knop283.Visible = False
Else
Knop283.Visible = True
End If
MsgBox strVoorstel
Me.Referentienummer.SetFocus
Referentienummer.Text = strVoorstel
Me.Productiedatum.SetFocus