473,289 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Prevent Duplicate Entry within a Month

Hello

I have an access database for transactions
I want to prevent duplicate entry against any account
Suppose i have an account (4422A) and i want it to pay only one in a month
If i enter this account twice access don't allow this entry.


please help me
Thanks
Jan 21 '22 #1
2 11188
NeoPa
32,554 Expert Mod 16PB
Hi Usman.

Welcome to Bytes.com.

I have approved your question as valid, yet I must point out that it makes little sense and everyone will find it hard to understand what you want as you tell us so little.

You say you want to prevent any duplicate entries, then you go on to say they are already prevented as indicated by the reported error message.

You will need to explain your problem very much more clearly if you expect anyone to be able to help you. There's no doubt we'd like to if only your question made sense. Unfortunately ...
Jan 21 '22 #2
isladogs
454 Expert Mod 256MB
I'll try interpreting what I think you mean...

I want to prevent duplicate entry against any account
Suppose i have an account (4422A) and i want it to pay only one in a month
If i enter this account twice access don't allow this entry.


You can easily prevent duplicate entries by indexing the account field and specifying no duplicates
However, I think you mean that it would be OK to pay that account again the following month.

So, you could use a field called YearMonth or similar where this month would be 2201 & Feb 2022 would be 2202

Now you could validate entries using a DCount expression. Something like:

Expand|Select|Wrap|Line Numbers
  1. If DCount("Payment", "tblPayments", "AccountID = " & Me.AccountID And YearMonth = Format(Date,"yymm"))=0 Then
  2.   'allow payment
  3. End If
This undoubtedly needs modifying but it might get you started

EDIT Crossposted on at least two other forums
Jan 22 '22 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: mmazid | last post by:
I would like to know how to prevent entering the same data as a primary key to an MS Access database and return with an error message confirming the data already exists in ASP.Net (VB.Net). ...
1
by: Joseph Chase | last post by:
I am running version 4.1.13a-log on a Mac XServe. How can I receive a 'duplicate entry' error for an UPDATE? An update isn't creating an entry, so why this error message? ...
8
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
5
by: baur79 | last post by:
Hi guys i try to run this code in loop and to pass even the entry is duplicated def email_insert_in_db(email): sql="INSERT INTO emails (email) values ('%s') "%(email)...
2
by: eazyone | last post by:
I can prevent a duplicate ID from being entered, but can't figure out how to go to that specific record. I keep getting an error message on: Me.Bookmark = rsc.Bookmark Its not opening and...
6
by: teser3 | last post by:
I have my PHP inserting into Oracle 9i. But how do I prevent duplicate record entries? I only have 3 fields in the insert in the action page: CODE <?php $c=OCILogon("scott", "tiger",...
1
by: chicago1985 | last post by:
I have a unique constraint in my Oracle table for 3 fields. If I enter duplicate info on the table using Oracle client I will get an Ora message error ORA-00001 that tells me it is a duplicate entry...
3
by: jacc14 | last post by:
Hi When I enter a job number i have set up the following Dim PID As String Dim stLinkCriteria As String Dim rsc As DAO.Recordset Set rsc = Me.RecordsetClone
4
by: waqasi | last post by:
I am allocating a unique number to a patient and want to prevent duplicate entry before update
2
by: nndkol | last post by:
I have used an UNBOUND form to add new record and used the vb code as follows: Private Sub cmdNew_Click() On Error GoTo Err_cmdNew_Click Dim rstAllotment As DAO.Recordset ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.