How to make the names stored in a list unique? - function

I created a variable that will prompt users to input their names 20x, the all those names will be appended into an empty list that I created, but I need a function that will constant check each name that was entered and compare it to other names in the list in order to ensure that it is unique, if similarity is found, the function should automatically add a unique number to that name to make it unique. The function should also enable users to enter not more than 20 characters and not less than 3 characters for their names. Id really appreciate it if someone can help me with this problem, thanks in advance. Also I would like it to be done with python programming language.
Here is an example of how i have tried to make the validation
CLICK THE LINK TO SEE MY EXAMPLE

Related

Format a field so it auto populates as a value without dashes from a value with dashes, Access 2013

I have two fields, SSN and ID#. The SSN is entered with dashes and the ID# field is the SSN number without dashes, used in other places of the database. These fields have been manually entered. I would like to automate the process so after a value has been entered in the SSN field (with dashes) it will automatically display in the ID# field without dashes. I can get this to work sort of but it is still slightly manual. If create a lookup for ID
SELECT [Table1].[ID#], [Table1].[SSN] FROM Table1;
this displays all of my entered SSNs without dashes in the drop down but I still have to select them from the drop down. To get the dropdown to update with new SSNs I have to refresh before I can select the newly added value in the ID dropdown. I was able to do this by creating the lookup for ID then I set the input mask for SSN. This is still a manual process and allows for error.
I am sure this is very easy but I am unable to find it. I would like the simplest approach possible. Any help/example is greatly appreciated. Please assume, I know next to nothing about Access. Thank you.
#June7
It's a very simple function. Replace([fieldname], "-", ""). Google it for more guidance. – June7 yesterday
Use that expression in VBA procedure (probably the SSN AfterUpdate event) to set the value of field. However, that is not really necessary. Can just use the expression in query or textbox to display SSN without dashes whenever needed. –

Searching through a CSV file to know the next macro action

So, I have my current bot (Yes, this bot is entirely legal. It's just a web scraper-esque bot) extracting data from a web page in a loop. But, at the beginning of the loop, I want it to be able to look through the previously-extracted data and compare it to the data on the page to choose what I want to do next. Is this possible?
For example:
Data is saved like this: name1,100,name2,200 Where names can be any string of letters, and the numbers can be any string of numbers.
To give you an idea on what the page looks like: It has two names, each with values under them, and buttons. The names and values change every minute or so.
First, we check the current names on the page. (There are two names on the page)
Next, we compare them to our database to see if they reside in it.
If they both do, we check the numbers after the name
If the first names number is higher than the seconds, we click the first names button
If the second names number is higher than the firsts, we click the second names button
Now we wait twenty seconds
Now, new values have appeared for both names. We find the mean of the new values presented to us and the old values, by adding them together and dividing by two.
What I really need help on is how to search through the CSV file for the names and then numbers after the names, and then how to save data to the same spot as the old data was from.
I know that this is easily possible in most programming languages (Java, C++, etc etc) but I wasn't sure if it would be possible in iMacros.
you can't save data in same csv as you use for search in imacros.
in regular imacros you do not have loop inside loop and IF statements as well, so you need to switch to javascript or similar.
extracting data from csv is simple: http://wiki.imacros.net/!COLn

Update single character in mysql field

I have a column dedicated to keeping track of which messages on my project were viewed. It's written like "10010", a 1 denoting that the message has been seen and also without making it into many different columns. But how do I make one database call to replace just the 3rd character, or the 5th character in the field? Thanks in advance!
The comment was right. If you want more informations you can go there :
Change a character in a field
You just have to change some things (in your project, you don't want to change the first character)

How to Create a Custom ID in Access 2010

The title of this Question may not be accurate because I wasn't sure how to ask the question.
Is there A way to have an ID field in AC 2010 the has a constant part and then a part of the ID that the user will enter in?
EXAMPLE: "EMP9066"
-I would like the "EMP" part of the ID to be constant at all times and the user should not be able to change it and the "9066" is a four digit that the user will be asked to type in.
Please Help.
_ Remember this is not SQL just basic access with some macros.
Thanks
Access has a data type called autonumber which will generate a unique number for each record automatically but it does not allow for the alpha prefix.
if it is indeed constant then the simplest approach is to prefix with it for display, ie in the table the field would be called recId (for example) and you would view the rows via a query with a calculated column
EmpId: "EMP" & format$(RecId,"0000")

A little Access VBA help? Validating against duplication of a non key field?

I am adding a part name to the database using a form, What code do I put behind the Add part button to validate against duplicate part names? (part number is the primary key) I think I need another recordset to search and compare the table but i'm a bit lost, any help would be great.
Private Sub btn_add_Click()
rs_parts.AddNew
With rs_parts
!partrno = lbl_partno.Caption
!Name = txt_name
rs_parts.update
end with
I've discussed my approach to this before, and given an example form for adding a new record.
I use an unbound form to collect the information needed to create the new record, and have it check for duplicates, and present a list of them to the user so the user can decide what to do.
In this case, it sounds like a unique index is in order, so you won't really need to worry about close matches. I would probably still use an unbound form to capture the new value and run the check before even attempting to add it. In that case, I'd just notify the user that it's a dupe.
Should you add a unique index to the part name field?
If you want, you can create a query on your part table with one column for the name and a parameter for the criteria they've entered in txt_name. Then pass the value they entered as a parameter to the query and see if you get any results.