LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Combobox userform help please

I have a userform for entering and editing data that has a combox on it
so the user can jump to a specific record to edit. I also have a "next"
button to go to the next record and a "previous" button to back a
record. If I leave the combobox blank in it's inital state I can change
data in the userform, hit the "next button" and the changes show up
correctly to the worksheet. However, once I use the combobox to jump to
a record and try make a change and hit the next button, instead of the
change showing up correctly on the worksheet, my record gets
overwritten and it messes up my worksheet.

Here is my code if anyone can advise on how to correct the above
problem.


Private Sub cmdNext_Click()
' Save form contents before changing rows:
SaveRow
' Increment row number:
lCurrentRow = lCurrentRow + 1
' Show contents of row in the form:
LoadRow
End Sub

Private Sub ComboBox1_Change()
Set rng = Range(ComboBox1.RowSource)
txtReqNum.Text = rng(ComboBox1.ListIndex + 1)(1, 1)
txtDateOpen.Text = rng(ComboBox1.ListIndex + 1)(1, 2)
txtType.Text = rng(ComboBox1.ListIndex + 1)(1, 4)
txtPriority.Text = rng(ComboBox1.ListIndex + 1)(1, 5)
txtTitle.Text = rng(ComboBox1.ListIndex + 1)(1, 6)
txtGrd.Text = rng(ComboBox1.ListIndex + 1)(1, 7)
txtRange.Text = rng(ComboBox1.ListIndex + 1)(1, 8)
txtExpected.Text = rng(ComboBox1.ListIndex + 1)(1, 9)
txtNR.Text = rng(ComboBox1.ListIndex + 1)(1, 11)
txtManager.Text = rng(ComboBox1.ListIndex + 1)(1, 12)
txtRecr.Text = rng(ComboBox1.ListIndex + 1)(1, 13)
txtStatus.Text = rng(ComboBox1.ListIndex + 1)(1, 14)
txtCandidate.Text = rng(ComboBox1.ListIndex + 1)(1, 15)
End Sub

Private Sub UserForm_Activate()
' Read initial values from Row 1:
lCurrentRow = Range("My_Range").Cells(4, 1).Row
LoadRow
ComboBox1.RowSource = Range(Range("My_Range").Offset(4), _
Range("My_Range").Offset(4).End(xlDown)).Address

End Sub

 
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
Value From ComboBox On UserForm jlclyde Excel Discussion (Misc queries) 3 October 16th 09 01:43 PM
ComboBox on a UserForm LLoyd Excel Worksheet Functions 2 February 20th 08 09:01 PM
combobox and userform help! dawn Excel Programming 3 October 11th 06 02:08 AM
ComboBox on UserForm Michel[_4_] Excel Programming 3 August 1st 04 11:10 PM
ComboBox on UserForm Michel[_4_] Excel Programming 2 July 31st 04 10:11 PM


All times are GMT +1. The time now is 01:20 AM.

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

About Us

"It's about Microsoft Excel"