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: 104
Default form problems

Hi,


Hi i have a program with multiple userforms, the user only gets to use
the forms as there interface. When using userform2 i some times get
the following error,


"the object has disconnected from its clients server"


when the debug button is pressed it always goes to one of thelines that

load the form
It does not seem to happen at a specific point. Only one userform
seems to have a problem below is some code that is assigned to one of
the command buttons on the userform.
The form displays a list box with data in it. The user selects a row
from that data, there are several command buttons that take that data
off the list and pastes to another part of the spreadsheet. each
command button assigns some different data to the row. When the
program takes the daat off the list the userform unloads and reloads
when its pasted somewhere else, so that the row the user selects
disapears in front of them. It seems as those the program is running
out of memory every now and then and just crashes. Hope this helps if
not i could always e-mail the programm to someone to have alook.


code for command button 1


Dim FIVEFOUR
Dim answer
Application.ScreenUpdating = False


Sheets("menu").Select


Call comfirststage
If ActiveCell.Value = "" Then Sheets("MENU").Select
If ActiveCell.Value = "" Then Application.ScreenUpdating = True
If ActiveCell.Value = "" Then Exit Sub


FIVEFOUR = InputBox(PROMPT:="How Many?")
If FIVEFOUR = "" Then MsgBox Title:="POLETRACKER", PROMPT:="You
have not entered a number. If you still wish to complete this job then
select a unit again and ensure you type in the quantity"
If FIVEFOUR = "" Then Call clearback
If FIVEFOUR = "" Then Application.ScreenUpdating = True
If FIVEFOUR = "" Then Exit Sub


Sheets("COM").Select
Range("a2").Select
ActiveCell.Offset(0, 9).Activate
ActiveCell.Value = FIVEFOUR
ActiveCell.Offset(0, -9).Activate
answer = MsgBox(PROMPT:="another unit?", Buttons:=vbYesNo +
vbQuestion)
If answer = vbYes Then Sheets("menu").Select
If answer = vbYes Then Application.ScreenUpdating = True
If answer = vbYes Then Exit Sub
If answer = vbNo Then Call proactivecom


code for COMFIRSTSTAGE


Sub comfirststage()
Sheets("COM").Select
Range("A1").Select


If ActiveCell.Value = "" Then MsgBox Title:="POLETRACKER", PROMPT:="You



have not selected a job. Please retry"


If ActiveCell.Value = "" Then Exit Sub


Sheets("COM").Select
clear = Range("a1")
Sheets("DISPLAY").Select
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=clear
Rows("2:700").Select
Selection.Copy
Sheets("COM").Select
Range("a3").Select
ActiveSheet.Paste
Range("A3:h3").Select
Selection.Copy
Range("a2").Select
ActiveSheet.Paste


CODE FOR PROACTIVECOM
Sub proactivecom()
Dim checker As Integer
Dim UNIT As Integer


checker = 0
UNIT = 0
Application.ScreenUpdating = False


Sheets("COM").Select
Range("A2").Select


Do While checker < 20


If ActiveCell.Value < "" Then UNIT = UNIT + 1
ActiveCell.Offset(0, 1).Activate


checker = checker + 1


Loop


If UNIT < 1 Then MsgBox Title:="POLETRACKER", PROMPT:="You cannot
complete this job as you have not assigned any units!"
If UNIT < 1 Then ActiveCell.Offset(0, -20).Activate
If UNIT < 1 Then Selection.End(xlToLeft).Select
If UNIT < 1 Then Exit Sub


Range("a2").Select


UserForm6.Show
End Sub


CODE FOR CLEARBACK


Sub clearback()


Sheets("COM").Select
Rows("1:1").Select
Application.CutCopyMode = False
Selection.ClearContents
Rows("2:2").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A1").Select
Sheets("DISPLAY").Select
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1
Range("A1").Select
Sheets("MENU").Select
Application.ScreenUpdating = True


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
Form problems in a table with merged cells JohnH Excel Discussion (Misc queries) 0 May 17th 10 08:32 PM
problems with a multitab form JulieD Excel Programming 0 September 7th 04 03:47 PM
Problems with j-walk data form Bob Reynolds[_3_] Excel Programming 0 July 2nd 04 03:47 AM
Form/Listboxes -- problems Stuart[_5_] Excel Programming 2 May 7th 04 07:23 AM
problems with Data Form macro Jeff Johnston Excel Programming 3 February 21st 04 12:15 AM


All times are GMT +1. The time now is 03:27 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"