Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Little User Form Problem

Status
Not open for further replies.

ninash

Technical User
Jul 6, 2001
163
GB
Hi All,

I have forms that users enter data into on an excel spreadsheet. However users being users it is possible for them to click a text box and skip entry in other boxes, this causes my problem.

If the user skips a box because the default value is ok for some reason the last value that was entered into that box stays on the spreadsheet..... even though code is supposed to copy the contents of the box to the spreadsheet.

I hope I have explained that right and you understand

Hoping you guys can help me again
 
Sounds like you are copying the data on TextBox_LostFocus. Why not copy the data when the OK button is hit? Then, you can validate the contents all at once.
 
I have done it under the GO button.
Firstly it checks for a few things in the cells and then it pastes the information from the cells into the spreadsheet by way of the following command line

Worksheets("Input").Range("D11") = TextBox3.Value

But if the user hasn't touched the box since the last time the form was used then the data isn't trensfered
 
Thanks

I must have been a little blonde at the time of writing that code

All sorted now thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top