#1
|
|||
|
|||
Unable to get a User Form to write changes
Sirs,
I am reasonable conversant with VBA in Access databases, but now have a need to create User Forms to make spreadsheets easier to update. I have a problem with a User Form that I do not understand. I have a number of text boxes on the user form that I populate from a worksheet. Putting the data into the form’s textboxes works well , the data displays exactly as it is in the workbook, and the text boxes accept changes. The intention is to change the data in the text boxes and write the changes back to the worksheet. After making a change, I do this by clicking on a command button5 which runs the following snipped of code. Private Sub CommandButton5_Click() ' SAVE button MsgBox MO.Text ‘ First MsgBox PutData End Sub Private Sub PutData() MsgBox MO.Text ‘ Second MsgBox Cells(r, 1).Value = LodgeNo.Text Cells(r, 2).Value = LodgeName.Text Cells(r, 3).Value = WM.Text Cells(r, 4).Value = SW.Text Cells(r, 5).Value = JW.Text MsgBox MO.Text ‘ Third MsgBox Cells(r, 6).Value = MO.Text Cells(r, 7).Value = SO.Text End sub I am using MO.text as text box to investigate The workbook cell has "Dave Parker" in it. When loaded into the user form MO.text has “Dave Parker” in it. I change the data to “John Smith” and click on button5 (save) MsgBox one shows MO.Text as being “John Smith” MsgBox two shows MO.Text as being “John Smith” (Both of which I expect and am happy with) MsgBox three, however, shows MO.Text as being “Dave Parker” (again) …… and the worksheet cell remains “Dave Parker” My question is what is wrong with my code that causes the data to revert to the original text in the worksheet? .... rather than the udpdated text in the user form. |
#2
|
|||
|
|||
Hey there MisterChips, why don't you post a sample workbook ?
We could then see what's actually happening instead of guessing. |
Tags |
user form write problem |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
text box appears after I press enter/try to write in bullet form | topgunitsme | Word | 1 | 08-13-2014 03:26 PM |
write need help and copy write need help on another page auto | wykoems | Word | 2 | 07-25-2013 07:56 AM |
unable to view Microsoft add-in when login as normal user | Cloud Ong | Outlook | 3 | 02-24-2012 03:12 AM |
Write to document from Access form | NISMOJim | Word | 9 | 06-23-2011 02:29 AM |
Why unable to use underscore in microsoft word styles( user defined)? | noufalcm | Word | 1 | 03-08-2011 01:46 PM |