Re: Setting focus to main form

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You have to set the focus to a control.

try

me.parent.NameOfControl.SetFocus
me.visible = false

The above syntax should work.

You 1st line of code needs to be changed.

You 2nd line of code may work as written...

Forms("frm_menu")!frmBKBox.Visible = False

So, just set the focus to an actual control on the main form, and that
should do the trick...

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@xxxxxxx



.



Relevant Pages

  • Re: Unable to use SetValue command
    ... You haven't posted an example of what you've tried, so I am guessing that ... your syntax is wrong. ... Try this as the "control name" argument: ... Ken Snell <MS ACCESS MVP> "simon wong" wrote in message ...
    (microsoft.public.access.macros)
  • Re: Disabling Controls
    ... code needs to be in the On Current and/or On Load ... Dim ctl As Control ...     Else ...
    (comp.databases.ms-access)
  • Re: Printing with Common Dialog Control
    ... Johan. ... >I have an application that I am developing using the Microsoft Common ... >Dialog control. ... What code needs to be their to ensure the default ...
    (comp.lang.basic.visual.misc)
  • Re: Dumb Question that I cant find the answer to.
    ... The .Value part is optional as Value is the default property for a control. ... Graham Mandeno [Access MVP] ... syntax. ...
    (microsoft.public.access.formscoding)
  • Re: Current Record?
    ... Considering your condition is based on just one control, ... would say the code needs to fire only when there is a change in the ... > Should it be in the On Current sub for the form? ...
    (microsoft.public.access.forms)