Those madding little moments

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to:
Sometimes but not always, when typing in a label control attached to another
cotnrol, textbox, list box, etc, Access extends the control downwards instead
of horizonally when the text exceeds the width of the control. This is
almost always not what I want to have happen and generally wastes a minute or
two resizing the controls back to where I want them. Is there a way to force
the controls to always extend horizontally?
Next one is a bigger issue. When working with tab controls, Access
"helpfully" shifts the size and position of the tab control whenever a new
control is added to a page or a control is moved on the page to accomdate the
control. This sometimes results in a madding amount of repositioning to put
things back where they should be. Is there any way to freeze the size and
position of tab controls in design mode so that added or repositioned
controls on a page cannot change the tab?
The biggest time waster of all
When debugging vba code, I will make changes to the code while stepping
through code or on a breakpoint or ... Recompile, save and then resume
execution. The problem is that if the form being edited is not in execute
mode, Access opens the form in design mode. Often I will make small changes
in the code behind several forms at one time. Then if after editing the
code, I forget to close the forms, Access throws an exception when I try to
open one of these forms while exercising the program. This means shutting
down, restarting Access and setting up the debug breaks, watches etc again.
This problem is aggravated by the fact that Access seems to want to lay
landmines by putting the forms at the back of the z order where they are not
always visible. Is there any option that will allow editing of vba code
without opening forms in design mode or to automatically close all forms open
in design mode when execution is resumed, with an F8 or F5 or ..?
 
For all your "questions" -- the answer is, "Not to my knowledge!". Sorry
'bout that. But we've all experienced what you have experienced....
 
About your last problem, you right, all the break point will disapear when
restarting the application, there is one solution for that, and it called
Stop.

Instead of a code break, you can write stop, and the code will stop there,
so everytime you start the application it will be there.
The problem with it is, you might forget to clear all the stop you have
used, and the user will have a problem
 
Thanks for the reply. I suspected as much but decided to ask in case I was
missing an option setting somewhere.
 
Thanks for the reply. I will consider you suggestion. My question howere
is less about how to save debug setups that about how to automatically close
forms silently opened in design mode by Access since that is the root of my
problem.
 
This isn't fully automatic, but it may help somewhat ...

Add the following code to a standard module, and you can call it from the
Immediate window when debugging. I added an optional argument you can use to
avoid closing the form you're actually working on. For example ...

CloseDesignForms "MyForm"

.... will close all forms that are open in design view except the form named
"MyForm".

If you foresee a situation where you might have more than one form you don't
want to close, you could modify the procedure to accept an array of form
names.

Public Sub CloseDesignForms(Optional ByVal KeepThisOneOpen As String)

Dim frm As Form
For Each frm In Forms
If frm.CurrentView = 0 Then
If frm.Name <> KeepThisOneOpen Then
DoCmd.Close acForm, frm.Name
End If
End If
Next frm

End Sub
 
Back
Top