Dcount With Dates

referee

Registered User.
Local time
Today, 14:04
Joined
Aug 21, 2003
Messages
38
hi,

in a table (tblplanner) i have this fields:
holidaydate = date
weeknumber= number
daynumber= number
forname =text
backname=text

now on my form they can select a name from a combobox the other fiekds wil filling automaticly thats no problem
when the above combination already exist in table i want a messagebox thats tell me that this record exist

the combo box called (cboOperator) is on a subform called frmregistration
the headform called frmstart

can someone help me with this code please.

thx
 
Last edited:
hi all,

can someone help me with this please

thx
 
Where does the combobox get the list of names from? Can you post your database and I'll try and help?
 
thanks for your reply

this is the sql from the combobox


SELECT qryOperators.Achternaam, qryOperators.Voornaam, qryOperators.Persnr, qryOperators.Team, qryOperators.Ploeg, qryOperators.Werkpostnr, qryOperators.Afdeling
FROM qryOperators
GROUP BY qryOperators.Achternaam, qryOperators.Voornaam, qryOperators.Persnr, qryOperators.Team, qryOperators.Ploeg, qryOperators.Werkpostnr, qryOperators.Afdeling
HAVING (((qryOperators.Team)=[forms]![frmPLANNER_A]![txtteam]) AND ((qryOperators.Ploeg)=[forms]![frmPLANNER_A]![PLOEG]));


The data go to the table (tblPlanner)
is this what you want to see?
the db is too big to send it

i hope you can help me

thx
 
Have you tried compacting your database to make it smaller. You can also delete the records (compact it afterwards) although leaving a few examples in might be useful.
 
HI

thanks for reply

i do the following and i have an error (type????)


Dim cdn As String
cdn = "[Achternaam] = '" & Nz(cmbOPERATOR.Column(0), "") & "'" And "[OPERATOR_VOORNAAM] = '" & Nz(cmbOPERATOR.Column(1), "") & "'"
cdn = cdn & " And VERLOFWEEK = " & Me!VERLOFWEEK And VERLOFDAG = " & Me!VERLOFDAG" And VERLOFDATE = " & Me!VERLOFDATE"


If DCount("*", "tblPLANNEN ", cdn) > 0 Then
MsgBox " SORRY, RECORD ALREADY EXIST, TRY AGAIN", bOKOnly, "Warning!!!"
Me.Undo
Exit Sub
Else

END IF

can you tell me what syntaxes are wrong or what else???
the combobox is in a subform called frmsubtest and the headform called frmhead
VERLOFWEEK AND VERLOFDAG are numbers
VERLOFDATE is a date
all others are text


THX
 
Last edited:

Users who are viewing this thread

Back
Top Bottom