Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Edit a userform

Instead of creating your own form, you may find it easier to use John
Walkenbach's Enhanced Data Form. It's a free add-in, allows combo boxes,
and has unlimited fields.

http://j-walk.com/ss/dataform/index.htm

You could use it to find and edit records in the database.

gregork wrote:
I have created a userform for enter data on to a sheet. I now want to have
an edit function on the user form so I can correct any errors via the same
form. I'm not sure of the right way to go about this so I would really
appreciate any advice or sample codes. Here's the code for the data entry
( I am planning to run the edit on command button4) :


Private Sub UserForm_Initialize()
Dim i As Integer
For i = 3 To 500
Me.ComboBox1.AddItem Worksheets("Raw Material").Cells(i, 1)
ComboBox1.Value = ""
TextBox1.Value = ""
Next

End Sub


Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Worksheets("Blend Sheet").Range("B22").End(xlUp)

LastRow.Offset(2, 0).Value = ComboBox1.Text
LastRow.Offset(2, 3).Value = TextBox1.Text

MsgBox "Record Written to Blend Sheet"


response = MsgBox("Do you want to enter another record?", vbYesNo)


If response = vbYes Then
ComboBox1.Text = ""
TextBox1.Text = ""

ComboBox1.SetFocus

Else
Unload Me
End If

End Sub
-------------------------------

Regards
gregork




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple user in excel to edit a userform Rachel Excel Discussion (Misc queries) 2 November 25th 08 04:47 PM
Edit exsisting data with userform Geo Excel Discussion (Misc queries) 2 October 1st 07 07:38 PM
View Row Data in UserForm / Edit Pete T[_2_] Excel Programming 1 October 17th 03 10:36 PM
Code to edit directly in cells from userform Tom Ogilvy Excel Programming 0 September 7th 03 10:27 PM
Code to edit directly in cells from userform Harald Staff[_4_] Excel Programming 0 September 7th 03 10:09 PM


All times are GMT +1. The time now is 02:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"