Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / April 2008

Tip: Looking for answers? Try searching our database.

Open Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rml - 10 Apr 2008 14:18 GMT
I have a form that onload, I have it set to maximize.  On that form, I have a
command button that opens another form with that record.  See code below.  
The problems is that when I click the button, the second form also maximizes
and does not seem to take the properties I have set on it.  IE: modal, pop
up, etc...

Why is this happening?

Thanks.

Private Sub Command384_Click()
Dim strWhere As String

   If Me.Dirty Then    'Save any edits.
       Me.Dirty = False
   End If

   If Me.NewRecord Then 'Check there is a record to print
       MsgBox "Select a record to print"
   Else
       strWhere = "[auto] = " & Me.[auto]
       
DoCmd.OpenForm "QC Form", acViewPreview, , strWhere
End If
End Sub
Golfinray - 10 Apr 2008 15:38 GMT
Try putting the end if before the docmd.openform

> I have a form that onload, I have it set to maximize.  On that form, I have a
> command button that opens another form with that record.  See code below.  
[quoted text clipped - 21 lines]
> End If
> End Sub
rml - 10 Apr 2008 16:28 GMT
Tried it but still the same.

> Try putting the end if before the docmd.openform
>
[quoted text clipped - 23 lines]
> > End If
> > End Sub
Klatuu - 10 Apr 2008 15:47 GMT
In the load event of the form you are opening

   Docmd.Restore

That will cause it to take on the shap and position it was when you last
saved the form.  It will also cause the other form to reduce it size, however.

Can you tell me why you are using a form to print a record?  Why not use a
report?   Reports are designed for printing, forms are not.
Signature

Dave Hargis, Microsoft Access MVP

> I have a form that onload, I have it set to maximize.  On that form, I have a
> command button that opens another form with that record.  See code below.  
[quoted text clipped - 21 lines]
> End If
> End Sub
rml - 10 Apr 2008 16:31 GMT
No, Docmd.Maximize
As for the form vs report.  Yes, I know but I'm using some code that shows a
photo and need some command buttons as well so a form works better in this
case for me.

I still need to figure out why this is happening.

Thanks.

> In the load event of the form you are opening
>
[quoted text clipped - 31 lines]
> > End If
> > End Sub
Klatuu - 10 Apr 2008 17:01 GMT
I thought you wanted the form you are opening to stay the way you designed it.
Signature

Dave Hargis, Microsoft Access MVP

> No, Docmd.Maximize
> As for the form vs report.  Yes, I know but I'm using some code that shows a
[quoted text clipped - 40 lines]
> > > End If
> > > End Sub
rml - 10 Apr 2008 17:07 GMT
I do.  I want both to stay.

> I thought you wanted the form you are opening to stay the way you designed it.
>
[quoted text clipped - 42 lines]
> > > > End If
> > > > End Sub
Klatuu - 10 Apr 2008 17:11 GMT
To stay what?
Can you describe this in a little more detail, please? Or is it working now?
Signature

Dave Hargis, Microsoft Access MVP

> I do.  I want both to stay.
>
[quoted text clipped - 44 lines]
> > > > > End If
> > > > > End Sub
rml - 10 Apr 2008 17:18 GMT
I have form A and on that form I have a command button.  When you click the
button it opens form B with the record you were on in form A.  Form A has
onload Maximize.  When you click the button and form B opens, it is maximized
and does not seem to take the properties I have set on it.  Modal, etc...

If I open the form B by itself, it works fine.

Does that make more sense?

Thanks.

> To stay what?
> Can you describe this in a little more detail, please? Or is it working now?
[quoted text clipped - 47 lines]
> > > > > > End If
> > > > > > End Sub
Klatuu - 10 Apr 2008 17:41 GMT
That is what I posted earlier.
Docmd.Restore will return form B to its saved size.
How are you determining it is not Modal?
Signature

Dave Hargis, Microsoft Access MVP

> I have form A and on that form I have a command button.  When you click the
> button it opens form B with the record you were on in form A.  Form A has
[quoted text clipped - 58 lines]
> > > > > > > End If
> > > > > > > End Sub
rml - 10 Apr 2008 19:22 GMT
Ok, that kind of works.  It does restore form B to its original state but it
makes form A be not maximized.  Also, I have form B set as Modal but it lets
you go to form A.  If I open form B up by itself, it keeps all the property
settings but when it is opened through form A, it seems to behave very
different.

Any more suggestions?

Thanks.

> That is what I posted earlier.
> Docmd.Restore will return form B to its saved size.
[quoted text clipped - 62 lines]
> > > > > > > > End If
> > > > > > > > End Sub
Klatuu - 10 Apr 2008 19:46 GMT
As I said in my first post, form A will change size.
Try opening the form using the acDialog option.  That way, you can't go
anywhere from it.
Signature

Dave Hargis, Microsoft Access MVP

> Ok, that kind of works.  It does restore form B to its original state but it
> makes form A be not maximized.  Also, I have form B set as Modal but it lets
[quoted text clipped - 72 lines]
> > > > > > > > > End If
> > > > > > > > > End Sub
rml - 10 Apr 2008 19:53 GMT
Sorry but what do you mean by acDialog option?  Can you explain how?

Thanks.

> As I said in my first post, form A will change size.
> Try opening the form using the acDialog option.  That way, you can't go
[quoted text clipped - 76 lines]
> > > > > > > > > > End If
> > > > > > > > > > End Sub
Klatuu - 10 Apr 2008 20:04 GMT
It is the 5th argument of the OpenForm method.
It sets the Modal and Popup properties to Yes.
Look in VBA Help for details.
Signature

Dave Hargis, Microsoft Access MVP

> Sorry but what do you mean by acDialog option?  Can you explain how?
>
[quoted text clipped - 80 lines]
> > > > > > > > > > > End If
> > > > > > > > > > > End Sub
Rick Brandt - 11 Apr 2008 01:14 GMT
> Ok, that kind of works.  It does restore form B to its original state
> but it makes form A be not maximized.  Also, I have form B set as
[quoted text clipped - 3 lines]
>
> Any more suggestions?

In Access if you maximize one thing you maximize all things. The exception
to this are forms and reports opened as popups.  Are you quite sure you set
the modal AND the PopUp property on form B to Yes?  Modal won't help with
the size issue, but PopUp should.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Linq Adams - 10 Apr 2008 17:49 GMT
As Klayuu said, in the FormLoad event of FormB use

  Docmd.Restore

This will keep the second form from maximizing.

Signature

There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Linq Adams - 10 Apr 2008 17:50 GMT
Sorry, Dave, typing with my glasses off!

>As Klayuu said, in the FormLoad event of FormB use
>
>   Docmd.Restore
>
>This will keep the second form from maximizing.

Signature

There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Klatuu - 10 Apr 2008 18:01 GMT
NP
I only need my glasses when I want to see <g>
Or is it you just washed your hands and you can't do a thing with them?
Signature

Dave Hargis, Microsoft Access MVP

> Sorry, Dave, typing with my glasses off!
>
[quoted text clipped - 3 lines]
> >
> >This will keep the second form from maximizing.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.