trying to close a form

  • Thread starter Thread starter fishqqq
  • Start date Start date
F

fishqqq

Hi have a simple piece of code that is giving me some problems.

As it sits right now it does what it is supposed to do in terms of
opening the right form. The problem is this code is on the onload
event of a form called [focac] and allthough the correct form is
opening when it should there is always form [focac] open on top of it.
I would like this form to close , leaving the intended form open.

I tried adding another docmd line that would run a macro that had
[focac] close but this gave me an error message that i can't seem to
get rid of either.

I think i'm leaving something simple out here but for the life of me i
don't know what that is.

Private Sub Form_Load()
If [Source] >= Then

DoCmd.OpenForm "fActCde"

ElseIf [Source] < [URL] Then
DoCmd.OpenForm "General Quote"


End If

End Sub
 
Sounds as if you have opened form [focac] in something other than 'normal'
mode and it is 'modal', that is, stays on top until dismissed. Check that,
and see if it was opened as in popup or other mode, and if changing to
normal mode will let it fall behind the newly opened form.

If not, it will improve the probability of us being able to help if you'd
give us details of how you opened [focac] and the exact error message... "an
error message" isn't very specific. Also, you speak of a macro to close
[focac] but show VBA code to open the other forms --

Larry Linson
Microsoft Office Access MVP
 
Back
Top