• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

userform should not overwrite

Antono

New Member
hello everybody,

I have this program where all info in inserted via userform. The thing is that not all info is available at once and therefor it maybe inserted at different times. But when the userform is used it will change all cells, also the empty ones. Is it possible to have the userform retrieve the info already inserted (this to allow users to see and, if necessary, make the changes)?
 
I need to add the following: in order to insert all the data I use 3 userforms. The first one adds the first part of the data and then calls the second one that inserts the second part and then calls the third one that inserts the final data before closing itself. and the data should always be the one on the active sheet
 
In most cases, you should submit unique ID for each line item in such a set up.
Use that column to:
1. Find last used row. + 1 to submit new data
2. Use ID# to identify which row the submitted data should update.

I'd recommend using ListBox to display row(s) that match search criteria and then, use selection on ListBox to update info.

Without sample workbook with your setup. It's difficult to give you more specific example.
 
Hello Chihiro, attached please find the actual workbook I am working on. As this is still work in progress some things might not work properly.
when you open it you should see a button that will open the first userform... the rest should be straight forward....
 

Attachments

  • Test.xlsm
    106.1 KB · Views: 10
Never mind my first idea. As I thought you were updating database like table through userform.

Looks more like static field update. I'll have to look through your code to understand functionality and/or constraints.

I'm actually going on camping trip starting tomorrow and won't be back till mid next week. Hopefully someone else helps you in the mean time. If not, I'll look at it when I get back.
 
I have found the solution to my problem... but just half of it:

first of all I have created a button in my workbook. This button will .show my userform AND retrieve the data from the activeworksheet using this code:

Sub OpenSelectionForm()

theeta = ActiveSheet.Range("ETA")
Insert_Data.TxtEta = theeta

Insert_Data.Show

End Sub

There is only 1 small problem. Most of the cell in the worksheet are formatted ad HH:MM. The result I get in my userform is, for instance, 0.5625 (instead of 13:30).... how can I format the textboxes in an userform to return time? the funny thing is that when I insert the times into the userform all is fine....
 
Hi there Marc, do you mind going explaining? the cells are all formatted short time HH:MM and they show the correct times. However, when I retrieve the data from the worksheet to the userform the times are shown as I mentioned above.
I also have the following code for each one of the textboxes that contain time:

Private Sub TxtEta_Afterupdate()
TxtEta.Value = Format(TxtEta.Value, "HH:MM")
End Sub
 
Back
Top