PDA

View Full Version : Error Message when Attempting to Use .setfocus property



Zephid15
05-17-2007, 12:13 PM
I want it to put focus to the PageMain. Is this the incorrect way to do this?
Sub Bcontinue_Click()
If MainRSM.Text = "<Select RSM>" Or MainRSM.Text = "" Then
pageMain.SetFocus
MsgBox ("Please select RSM name before continuing.")
Exit Sub
End If
AddTable
Unload Me
End Sub

lucas
05-17-2007, 12:41 PM
is pageMain a textbox?

lucas
05-17-2007, 01:02 PM
Is MainRSM a textbox?
You leave too much in the dark zeph..
Example Query:
I want:
If textbox MainRSM contains <Select RSM> or is blank for a messagebox to come up that says...Please select RSM name before continuing
and set focus back to the MainRSM textbox.

If textbox MainRSM contains anything else then setfocus to textbox pageMain...

We can't read minds.

Zephid15
05-17-2007, 01:25 PM
sorry about that, pagemain is a tab. what i want to happen is if the RSM (a combo box) is not selected then it gives an mesage and goes to that tab.

lucas
05-17-2007, 02:19 PM
If MainRSM.Text <> "<Select RSM>" Or MainRSM.Text = "" Then
MultiPage1.Value = 0
MsgBox ("Please select RSM name before continuing.")

lucas
05-17-2007, 02:19 PM
You have to use index numbers of the pages on a multipage form....they start at 0