J
jeanhurtado
Hi, I'm Jean and looking to see how I can prevent duplicate records in
a table. I have a form that is called "Tickets" this form generate the
current date in a date field in a table, using a macro. This macro
execute using a command button. I want to create a method in the
macro code that review first that date that are contain in a textbox
and then check if this date is in the field of the table and then a
message that shows that you cannot duplicate the date in the table
then close and cancel the macro. I have part of the code but is not
complete. Did you have an idea?Thanks you for your support.
*********************************************************************************************************************************
Dim duplicatedate As DAO.Recordset
Dim strSearchName As String
Set duplicatedate = refenrecen to table and date field???????????
strSearchName = Str(Me!TICKETDATE)
duplicatedate.FindFirst txtTicketDate.Value & strSearchName
If duplicatedate.NoMatch = False Then MsgBox _
"The Ticket Date you selected to print has been already printed or
generated. Please select another date.", vbCritical, "Duplicate Date"
***********************************************************************************************************************************
JC
a table. I have a form that is called "Tickets" this form generate the
current date in a date field in a table, using a macro. This macro
execute using a command button. I want to create a method in the
macro code that review first that date that are contain in a textbox
and then check if this date is in the field of the table and then a
message that shows that you cannot duplicate the date in the table
then close and cancel the macro. I have part of the code but is not
complete. Did you have an idea?Thanks you for your support.
*********************************************************************************************************************************
Dim duplicatedate As DAO.Recordset
Dim strSearchName As String
Set duplicatedate = refenrecen to table and date field???????????
strSearchName = Str(Me!TICKETDATE)
duplicatedate.FindFirst txtTicketDate.Value & strSearchName
If duplicatedate.NoMatch = False Then MsgBox _
"The Ticket Date you selected to print has been already printed or
generated. Please select another date.", vbCritical, "Duplicate Date"
***********************************************************************************************************************************
JC