Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userforms.....


I hope someone can help....

I have a worksheet that has multiple userforms with it. One in a
entry form where the user enters tool information, and when the sav
button is clicked, saves the info to a worksheet "Log" with a name
range "MasterLog" which is the entire sheet. This one works great.

The next userform is for editing the records that were entered in th
first one. I have a combobox (cboID) that is linked to the "Log" b
setting the properties of the ControlSource to Log!A1
and RowSource to MasterLog. I need to make it so I can select the dro
down and see all the records that have been entered (approx. 650)
select the one I need and have it refresh to the textboxes that appea
on the form. This is the code I have (and it works fine in a differen
workbook):

Private Sub UserForm_Initialize()

'Open Log where records are stored
ActiveWorkbook.Sheets("Log").Activate
Range("A2").Select


'Find selected record and pull it to the form
Do
If cboID < ActiveCell Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until cboID = ActiveCell

txtEquip.Value = ActiveCell.Offset(0, 1)
txtLoc.Value = ActiveCell.Offset(0, 6)
txtEmp.Value = ActiveCell.Offset(0, 7)
txtRecall.Value = ActiveCell.Offset(0, 9)
txtStatus.Value = ActiveCell.Offset(0, 10)

'Set up new entry boxes

txtLoc2.Value = txtLoc.Value
txtEmp2.Value = txtEmp.Value
txtCertDate.Value = txtRecall.Value
txtStatus2.Value = txtStatus.Value
txtComments.Value = "N/A"

End Sub

The problem I'm having is that when I run the form in this particula
workbook, it is not giving me the opportunity to go to the combo bo
first to select what I need. I can step through this, it selects th
worksheet and cell okay, but then just loops (and loops and loops
through all 65000+ rows and gives an error.

I have tried comparing the two codes side by side looking for what I'v
missed from the working one to the non-working one, but I just can'
see it. I'm hoping that a fresh set of eyes looking at i
will help.

Thanks in advance to anyone who may be able to help me out, and have
great day

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Userforms.....

It looks as if the line that tests if the cboID < ActiveCell is not finding
a match. Try using the value property of the cboID in the test.

If cboID.Value < ActiveCell Then

etc...


Cheers
N

"Candee" wrote in message
...

I hope someone can help....

I have a worksheet that has multiple userforms with it. One in an
entry form where the user enters tool information, and when the save
button is clicked, saves the info to a worksheet "Log" with a named
range "MasterLog" which is the entire sheet. This one works great.

The next userform is for editing the records that were entered in the
first one. I have a combobox (cboID) that is linked to the "Log" by
setting the properties of the ControlSource to Log!A1
and RowSource to MasterLog. I need to make it so I can select the drop
down and see all the records that have been entered (approx. 650),
select the one I need and have it refresh to the textboxes that appear
on the form. This is the code I have (and it works fine in a different
workbook):

Private Sub UserForm_Initialize()

'Open Log where records are stored
ActiveWorkbook.Sheets("Log").Activate
Range("A2").Select


'Find selected record and pull it to the form
Do
If cboID < ActiveCell Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until cboID = ActiveCell

txtEquip.Value = ActiveCell.Offset(0, 1)
txtLoc.Value = ActiveCell.Offset(0, 6)
txtEmp.Value = ActiveCell.Offset(0, 7)
txtRecall.Value = ActiveCell.Offset(0, 9)
txtStatus.Value = ActiveCell.Offset(0, 10)

'Set up new entry boxes

txtLoc2.Value = txtLoc.Value
txtEmp2.Value = txtEmp.Value
txtCertDate.Value = txtRecall.Value
txtStatus2.Value = txtStatus.Value
txtComments.Value = "N/A"

End Sub

The problem I'm having is that when I run the form in this particular
workbook, it is not giving me the opportunity to go to the combo box
first to select what I need. I can step through this, it selects the
worksheet and cell okay, but then just loops (and loops and loops)
through all 65000+ rows and gives an error.

I have tried comparing the two codes side by side looking for what I've
missed from the working one to the non-working one, but I just can't
see it. I'm hoping that a fresh set of eyes looking at it
will help.

Thanks in advance to anyone who may be able to help me out, and have a
great day!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
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
I need some help with userforms T.c.Goosen1977 Charts and Charting in Excel 0 June 30th 06 09:29 AM
I need some help with userforms T.c.Goosen1977 Excel Discussion (Misc queries) 0 June 30th 06 09:27 AM
UserForms bennyob Excel Discussion (Misc queries) 4 November 7th 05 01:58 PM
userforms Dave[_27_] Excel Programming 1 August 28th 03 06:25 PM
Userforms Gary[_8_] Excel Programming 1 August 18th 03 03:26 PM


All times are GMT +1. The time now is 11:54 PM.

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"