LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
DJ DJ is offline
external usenet poster
 
Posts: 3
Default Problems with Multiple Instances of User From

I have an Excel macro that displays a user form to capture user input. When
the OK command button is clicked the code assigns values from the form's
objects (text boxes and combo boxes) to various variables, then performs
error checks on the input data. If an error is found, I hide the user form,
execute a Select Case statement to set the focus to the form object
containing the invalid data, then redisplay the form using the following
code:

If Not InputError = Empty Then

frmAirbillInput.Hide
Select Case InputError

Case "InvalidZIPCode"
With tbZIPCode
.SelStart = 0
.SelLength = Len(.Text)
frmAirbillInput.tbZIPCode.SetFocus
End With

Case ...

Case ...

End Select

frmAirbillInput.Show
End if

Unload frmAirbillInput
Application.ScreenUpdating = True
frmProgress.Show

End Sub

If there are no errors in the input data, all works well. However, when
invalid input data is entered that causes the form to be redisplayed by one
of the Select statements, the program acts as though there are multiple
instances of the same form opened. For example, when I'm stepping through
the program and there are no input errors, control is returned from
frmProgress, flows to the End Sub statement and the program exits. When
there are input errors causing the form to be redisplayed one or more times
by a Select statement, when I step through the program control returns from
frmProgress, flows to the End Sub, then flows to the End if statement.

What am I missing or doing wrong? All assistance is highly appreciated!

Thanks,

DJ


 
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
add multiple x values to multiple instances of y coordinate evrk Charts and Charting in Excel 0 January 18th 11 10:57 PM
Multiple instances of Excel (Multiple workbooks) Shane Setting up and Configuration of Excel 3 November 13th 09 05:07 PM
Create list of unique instances from list of multiple Instances Dishon Excel Worksheet Functions 0 March 3rd 08 10:46 AM
Shared workbook: multiple user instances Mike G[_2_] Excel Discussion (Misc queries) 0 July 26th 07 04:56 PM
Multiple instances Neil Levy Excel Discussion (Misc queries) 2 June 23rd 07 01:13 AM


All times are GMT +1. The time now is 08:58 PM.

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"