Problem with the setfocus

elliot315

Mr. Question
Local time
Today, 00:07
Joined
Jun 3, 2007
Messages
98
I have an option group for a search form
I want to select an option and the focus sets automatically to the search criteria field text... I used the setfocus and it does it right BUT it doesn't allow me to select anything else in the form after that... what Im doing wrong?
 
Eliot,

Hard to guess without seeing it.

You say it properly sets Focus to some text field ... then can't select anything
else. Is the form totally dead? Could some code be running?

Can you post the DB, or show the relevant code?

Wayne
 
so, the setfocus is just for that.. and then?! i just want toput the cursor on the text field, and be able to use the form again without exiting... lets say I select one option by mistake.. if I want to select the correct one.. I'm not allowed to do it, becuase the cursor gets locked there on the text field.
 
Eliot,

I think that you have something going on here, like some code running in the
text boxes LostFocus event. Are you aware of any code that may be trying
to "verify" your entry (or lack of) without informing you with a message box?

Wayne
 
the only code behind is the one that make null the text field, to clear any entry done before, and the other is a message box that comes if no entry has been done.
 
Elliot,

You make an entry in an Option Group.

The textbox is cleared.

You SetFocus to the textbox.

Can you enter data in the textbox?

If you can enter data, are you just "stuck there" afterward?

If you can't enter data, are you just "stuck there" also?

Wayne
 
I can enter data but I can't click outside the field text.. it doesn't allow me to select anything else
 
I used the setfocus and it does it right BUT it doesn't allow me to select anything else in the form after that

elliot315 said:
the only code behind is the one that make null the text field, to clear any entry done before, and the other is a message box that comes if no entry has been done.
So, you say the only code is one that nulls a field, one to clear an entry, and a messagebox. If that's true, then how is the first quote true? How are you using SetFocus and where?
 
Private Sub Option19_GotFocus()
Me.txtCriterioRegistro.Visible = True
Me.txtCriterioRegistro.SetFocus
Me.txtCriterioDueno.Visible = False
Me.txtCriterioComercio.Visible = False
Me.txtCriterioSS.Visible = False
Me.Combo51.Visible = False
Me.txtCriterioDueno.Value = Null
Me.txtCriterioComercio.Value = Null
Me.txtCriterioSS.Value = Null
Me.Combo51.Value = Null
End Sub
 
What other controls are visible and available to select (if you could) when you are in that text box? I would get rid of the Got Focus event on the Option. Why are you setting focus on the text box if the option gets the focus? You should be using the Frame's (not the radio button) AfterUpdate event to test it's value and set the appropriate things based on the selection of the option within the Option Frame.
 
I'm going to try that now... I thought about it (the Get focus), but I didn't thought about the frame... I'll try it now and let you know... THANK YOU
 
another thing... I really want to protect my db I read about some security measures.. like writing a text somewhere in the registry and look for that text
when the db loads.. I'm a newbie in Access so my coding knowledge in VBA is almost 0.... could you give me some hints to protect my db?
 
Protect it from what, exactly? It all depends on what you are meaning as to what you need to do. Some things might be beyond your current capabilities, but again that all depends on what you are trying to achieve.
 
I just want to know who installs the db..I know about the MDE file... but that doesn't prevent to use it without my authorization.. I mean.. to ask for a serial number or something like that
 

Users who are viewing this thread

Back
Top Bottom