473,398 Members | 2,335 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,398 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 11195
NeoPa
32,556 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
456 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 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.