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: 1
Default setfocus on control works on some computers and not others

I have an excel workbook with a nonmodal multipage form. I have a
little validatiion routine that looks to see if a textbox is filled in
on the previous tab when moving to the next. If it is not filled in it
is supposed to go back to that tab and that textbox.

I'll put the two parts of code below, but, the problem is that the
routine works on some computers and not others. I have checked the
references and there are none missing. Two of them are XP with office
XP installed. It works on one and not the other.

Does anyone have any ideas on this?

Thanks

The code:

First Part:

Public Sub setSubwayMap()

Rem First restore the labels to default color and size


Controls("L" & curstep).ForeColor = vbWhite
Controls("L" & curstep).Font.Size = 12


Rem - depending on Tab value set curStep- current step
Select Case tabs.Value
Case 0
curstep = "intro"
Case 1
curstep = "material"
Case 2
cmbDischType.SetFocus
curstep = "discharge"
Call MaterialValCheck...


Second Part the validation routine:

Private Sub MaterialValCheck()
If TxName.Text = "" Then
Beep
MsgBox "Material name must be filled in"
tabs.Value = 1
curstep = "material"
TxName.SetFocus
Exit Sub
End If
If TxCAS.Text = "" Then
Beep
MsgBox "CAS number must be filled in"
tabs.Value = 1
TxCAS.SetFocus
Exit Sub
End If
If PercSub.Text = "" Then
Beep
MsgBox "Percent material in product must be filled in"
tabs.Value = 1
PercSub.SetFocus
Exit Sub
End If
If PrtConc.Text = "" Then
Beep
MsgBox "Parts concentrate for working solution must be filled in"
tabs.Value = 1
PrtConc.SetFocus
Exit Sub
End If
If PrtWork.Text = "" Then
Beep
MsgBox "Parts Water to make up working solution must be filled in"
tabs.Value = 1
PrtWork.SetFocus
Exit Sub
End If
End Sub



Private Sub DischargeValCheck()
If Dur.Text = "" Then
Beep
MsgBox "Duration of discharge must be filled in"
tabs.Value = 2
Dur.SetFocus
Exit Sub
End If
If txDischQ.Text = "" Then
Beep
MsgBox "Total Discharge flow must be filled in"
tabs.Value = 2
txDischQ.SetFocus
Exit Sub
End If
If FacQ.Text = "" Then
Beep
MsgBox "Total facility flow must be filled in"
tabs.Value = 2
FacQ.SetFocus
Exit Sub
End If
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
Formula only works on some computers Libby Excel Worksheet Functions 16 May 12th 08 02:02 PM
Macro works differently on different computers, same version of Ex oscardwilde Excel Discussion (Misc queries) 6 December 28th 05 11:22 PM
How do I convert works file to excel without works software? CatMB Excel Discussion (Misc queries) 1 June 21st 05 04:12 PM
adding Activex control through code works BUT... Cannot access ob keepITcool Excel Programming 0 July 14th 04 04:28 PM


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