Access Function to add numbers 1,2,3...n to field values that are duplicates

Completed Posted Jan 15, 2014 Paid on delivery
Completed Paid on delivery

I need a simple VBA function for MS Access (2010) that I can use in an update query to

1) checks the strings in a given field for duplicates

2) then, for strings that have duplicates, add digits to its end.

Example of the input and the expected output:

K17B8897 --> K17B8897-0

K17B8897 --> K17B8897-1

H19R1234 --> H19R1234-0

H19R1234 --> H19R1234-1

H19R1235 --> H18R1235

P22K4456 --> H22K4456

K17B8897 --> K17B8897-2 (mind the hyphen!)

K17B8897 --> K17B8897-3 (mind the hyphen!)

The output strings should be put into a new field, which the function should create itself, ideally to the right of the source field.

The function will have three parameters:

CheckDuplicates(WhichFieldToCheck, NameOfFieldToCreateForOutput; StartWithNumber)

The parameters are

- WhichFieldToCheck: Name of the field to check

- NameOfFieldtoCreateForOutput: Possibility to set a name for the new column that will be created; if not name is given, "Modified" is used.

- StartWithNumber: Set a number to start with, e.g. 1000 --> 1000, 1001, 1002...; if not set, counting starts with 0.

For delivery, it is sufficient to send me the VBA code; I will myself create a module to store it where I need it.

Visual Basic for Apps

Project ID: #5325031

About the project

9 proposals Remote project Active Jan 16, 2014

Awarded to:

MDavidCrompton

I have been developing applications in both Access and Excel for 20 years with extensive use of VBA. I have developed several applications for Freelance clients, please see Feedback. I am UK based, a native English More

$25 USD in 1 day
(2 Reviews)
3.6

9 freelancers are bidding on average $31 for this job

sumon355

Hello, How are you? Can you remember me? I did one of your project( perhaps 2 years ago) and that was my first project in vWorker.com. Anyway, i am interested to do this work, waiting for a positive response from you. More

$25 USD in 1 day
(7 Reviews)
3.2
maverick44000

Hi Chgeiselmann. Your requirement requires a recursive query function that would make a lot of queries and would slow down the system. What if I write you a VBA function in Excel that would do the following with the sa More

$30 USD in 1 day
(3 Reviews)
3.2
NourElDeen

Dear Sir, I'm Expert with access, talent with VBA, and i'm interested in doing your project. I have a part of that function just few modification and it will be ready. Kind Regards, NourElDeen

$29 USD in 1 day
(9 Reviews)
3.2
paris2785

VB, VBA and Databases expert for over a decade. Master in Information Systems. I have delivered similar projects in the past. Please check https://www.freelancer.gr/projects/Data-Processing-Excel/data-translation-e More

$25 USD in 1 day
(1 Review)
0.8
XFastSolution

Dear sir, I've read you requirement carefully. With expertise in VBA and much experience working with Acess-SQL, I could be a good fit. Kind regards, LY

$50 USD in 2 days
(0 Reviews)
0.0
derrickpogi

Hello There, I am excited to do this. I can complete this by today. Why you should choose me? 1.) I am proficient in VB, VBA. I can show you projects I have made if you want. 2.) I give timely updates on the More

$30 USD in 1 day
(0 Reviews)
0.0
rightfreelancer7

I am a professional software engineer with 9+ years of experience. I am very talented programmer with the following skills c, c++ , java ,VB, UNIX, Linux,SSH, PHP, Jsp , Js , advanced js like jquery, extjs etc. My ski More

$30 USD in 2 days
(0 Reviews)
0.0
pnjadhav

I am available right now. I am a expert Database Architect. I have done lots of database design and development for desktop and web based applications using .Net, LAMP, Flash Action Script, HTML 5, Java Script, JQuery, More

$35 USD in 1 day
(0 Reviews)
0.0