On Error GoTo Err_btnOpenMyForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "MyForm"
stLinkCriteria = "[ClientID]=" & Me![ClientID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_btnOpenMyForm_Click:
Exit Sub
Err_btnOpenMyForm_Click:
MsgBox Err.Description
Resume Exit_btnOpenMyForm_Click
Jeanette Cunningham said:
What do you have for the code on the main form that opens the other form
for
each button?
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Hi,Jeanette.
There is no code related to this form at all eccept for CLose and
GoToNewRecord buttons. First I saw such a pattern in Microsoft example
DB -
opening form and then opening its subform independently from the main
DB
window and changing its view to Design mode would close the former
form.
This
made sense to me.
But in my case the second form is not a subform, though it's bound to
the
former by link criteria. To double-check myself I've created another
button
opening third form again with link criteria and tried to change it to
Design
mode after opening - no problem.
So, I guess, it has something to do with the form properties.
What do U say?
:
Hi Mishanya,
check for any code in the unload event of the form that might be doing
this.
Jeanette Cunningham
I have a form with control button wich opens other form. Somehow the
latter
form "have learnt" to close the former while I change it to
DesignView.
Other
similar forms "behave themselves" - so, I guess, I accidentally
changed
something in the rebellious form.
What property is responsible for such a misbehaviour?