473,657 Members | 2,450 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Prevent Duplicate Entry within a Month

4 New Member
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 11213
NeoPa
32,568 Recognized Expert Moderator MVP
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
459 Recognized Expert Moderator Contributor
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
1632
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). Function AddFault(ByVal faultID As Integer, ByVal username As String, ByVal title As String, ByVal desc As String) As Integer Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\Documents an"& _ "d...
1
6426
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? ____________________________________________________ 060427 11:57:23 Slave SQL thread initialized, starting replication in log 'kiosk1-bin.000006' at position 7233, relay log './royaldemo-2-relay-bin.000007' position: 7321 060427 11:57:23 Slave: Query caused...
8
3927
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 this line: Set rs = db.OpenRecordset("SELECT ID FROM Contacts WHERE (" & sWhere & ");") Contacts being the main table. I am using access 2003 The error message states that there are; Too few parameters. Expected 1 I have no idea how to...
5
22998
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) db=_mysql.connect(host = "localhost", user = db_user, passwd = db_pass, db = db_name)
2
3212
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 displaying the duplicate record, can anyone help? Here's a snipet of the code for before Update Private Sub RegNumber_BeforeUpdate(Cancel As Integer)
6
4543
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", "orcl"); if ( ! $c ) { echo "Unable to connect: " . var_dump( OCIError() );
1
3384
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 attempt. How do I capture that in my PHP page if someone tries to enter duplicate record info? My PHP Oracle insert statement in the action page: $s = OCIParse($c, "insert into tableOne values ('$varOne', '$varTwo', '$varThree')");...
3
2108
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
3553
by: waqasi | last post by:
I am allocating a unique number to a patient and want to prevent duplicate entry before update
2
1191
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 Set rstAllotment = CurrentDb.OpenRecordset("SELECT * FROM ") rstAllotment.AddNew rstAllotment! = Me.cmbFY.Value rstAllotment! = Me.cmbPNP.Value rstAllotment! = Me.cmbDmnd.Value
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.