Do autonumber in forms
Closed
Clara
-
May 30, 2010 at 01:38 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 30, 2010 at 12:35 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - May 30, 2010 at 12:35 PM
Related:
- Basot email structure
- Wpan full form in computer - Guide
- Crystal report windows forms viewer download - Download - Data management
- Numbers in word form - Guide
- Agp full form in computer - Guide
- Google forms right to left - Guide
4 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 30, 2010 at 02:55 AM
May 30, 2010 at 02:55 AM
What software are you talking about. If you are talking about access that is how works.
Sorry if I did not say anything before, I'm working with excel. I know acccess do that, but I want to do that in excel.
I have a form where the user enter the information of insurance discrepancies. I want an autonumber to be created everytime the user save the form, but also he or she could be able to know the number I mean that the number coul be seen on the form but can not be changed by the user..
Thanks
I have a form where the user enter the information of insurance discrepancies. I want an autonumber to be created everytime the user save the form, but also he or she could be able to know the number I mean that the number coul be seen on the form but can not be changed by the user..
Thanks
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 30, 2010 at 10:27 AM
May 30, 2010 at 10:27 AM
You have to do it with code. You would need to lock the cell
and have the value populated via macro
and have the value populated via macro
That's the problem I do not know how to do it, do you have an example of an existing excel file that I can use. I would appreciate that.
Clara.. Thanks
Clara.. Thanks
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 30, 2010 at 11:43 AM
May 30, 2010 at 11:43 AM
Yeah I kind of suspected that after I posted the message, I noticed your name. I guess you were the one who was looking for changing the text of the button.
The answer to this one is simple and not so simple. For that one has to look at the form. Here is the basic idea
To lock the cell.
First select all the cell and right click and go to format
There is option for protection. Uncheck the box.
Now right click the cell where you want that value to be and again go to format and enable the lock.
Now the lock is not operational till the sheet is lock. You need to go o Review tab and there is a protect worksheet option.
Now this all prevents a user to type in the value there.
Now to auto increment the lock cell. For that you have to change the code for the button
Write a sub like this
Now in the code for button, add one more line
The answer to this one is simple and not so simple. For that one has to look at the form. Here is the basic idea
To lock the cell.
First select all the cell and right click and go to format
There is option for protection. Uncheck the box.
Now right click the cell where you want that value to be and again go to format and enable the lock.
Now the lock is not operational till the sheet is lock. You need to go o Review tab and there is a protect worksheet option.
Now this all prevents a user to type in the value there.
Now to auto increment the lock cell. For that you have to change the code for the button
Write a sub like this
Sub incrementValue() Dim currentValue As Variant 'Assuming that the locked value is on sheet1 and cell C1 currentValue = Sheets("Sheet1").Cell(1, "C").Value ' if the cell is blank then, value is 0 If currentValue = "" Then currentValue = 0 ' a safety issue. In case the value in cell c1 was not numeric then we dont want to mess up If (IsNumeric(currentValue)) Then currentValue = currentValue + 1 Sheets("Sheet1").Cell(1, "C").Value = Right("000" & currentValue, 3) End If End If
Now in the code for button, add one more line
Call incrementValue
Hi, The sub should be in the form, the sheet a module, sorry, as you might noticed, I'm a newbie....
Thanks
Thanks
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 30, 2010 at 12:35 PM
May 30, 2010 at 12:35 PM
It is code for the form.