![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
I have a form with a double click event what happens is a line is selected then double clicked its then supposed to fire up another form with the detail from the first form
it works on the first line when double clicked but in any other line I get application defined or object defined error heres my code Private Sub UserForm_Initialize() Dim SourceRange2 As Range Set SourceRange2 = Range(UserForm2!ListBox1.RowSource) F3FirstName = SourceRange2.Offset(UserForm2!ListBox1.ListIndex, 0).Resize(1, 1).Value TXTFirstNameU3.Text = SourceRange2.Offset(UserForm2!ListBox1.ListIndex, 0).Resize(1, 1).Value TXTSecNameU3.Text = SourceRange2.Offset(UserForm2!ListBox1.ListIndex, 1).Resize(1, 1).Value TXTStAddyU3.Text = SourceRange2.Offset(UserForm2!ListBox1.ListIndex, 2).Resize(1, 1).Value TXTSuburbU3.Text = SourceRange2.Offset(UserForm2!ListBox1.ListIndex, 3).Resize(1, 1).Value TXTCityU3.Text = SourceRange2.Offset(UserForm2!ListBox1.ListIndex, 4).Resize(1, 1).Value TXTCountryU3.Text = SourceRange2.Offset(UserForm2!ListBox1.ListIndex, 5).Resize(1, 1).Value end sub so that when this form opens it displays information from userform2 this code is in userform3 the listbox is in userform2 post back if you cannot understand I may have to send my workbook for you to look at! |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Range(UserForm2!ListBox1.RowSource) ' should be ' Range(UserForm2.ListBox1.RowSource) ' ' ' Also note that the Rowsource should be explicitly addressed eg Sheet1!A1:A10 Where Sheet1 is the Name of the sheet and not the Code name, just incase you work between Diffeent sheets. If This doesn't work then feel free to email me...I'm in the MAIN LAND Go Crusaders !! _________________ Kind Regards, Ivan F Moala [ This Message was edited by: Ivan F Moala on 2002-05-16 00:22 ] |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
Yeah I heard the All Blacks were playing the Highlanders on Saturday Night 7.30
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|