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 / May 2008

Tip: Looking for answers? Try searching our database.

pop behind

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rml - 22 May 2008 15:59 GMT
I have the following code on a form.  The form is modal and popup.  This
allows me to maximize the form on load.  My problem is that when I click that
button, it is behind the main form.  How can I make it be in front without
losing the modal and popup?

Thanks.

Private Sub Command265_Click()
On Error GoTo Err_Command3_Click

   'Old Code
   '========================
   'Dim stDocName As String
   'stDocName = "Codes"
   'DoCmd.OpenQuery stDocName, acNormal, acEdit
   
   Dim strSQL As String
   
   'Construct our SQL Statement
   strSQL = "SELECT code, [Codes].Make, [Codes].Description" & _
            " FROM [Codes]" & _
            " WHERE code IN (" & fcnFormatList([Forms]![parts]![Model]) &
");"
   
   'Execute the SQL through the Current Project connection
   CurrentProject.Connection.Execute "CREATE VIEW tempView AS " & strSQL
   
   'Open the Query
   DoCmd.OpenQuery "tempView", acViewNormal, acReadOnly
   
   'Drop the Query
   CurrentProject.Connection.Execute "DROP VIEW tempView"
   
Exit_Command3_Click:
   Exit Sub

Err_Command3_Click:
   MsgBox Err.Description
   Resume Exit_Command3_Click
   
End Sub
Maurice - 23 May 2008 14:28 GMT
Difficult if you don't want to lose the modal and popup because that's what
modal and popup do.

You might give it a try by setting the modality of the form temporarily to
non-modal en when the query is closed set it back to modal again.

Something like:

me.modal=false
docmd.restore '- removing the maximization of the form so the query can be
viewed

the form will stay in front of the query due to the popup setting.
The only thing you have to figure out is how to set the modality back to
modal again with me.modal=true.

I think you are better of creating a form in datasheet mode displaying the
records.

Create a second form
Open the second form from the first form showing the query results in
datasheetview as follows:

DoCmd.OpenForm "form2", acNormal, , , , acDialog

this will open the form in front of the first form without losing the modal
and popup features...

hth
Signature

Maurice Ausum

> I have the following code on a form.  The form is modal and popup.  This
> allows me to maximize the form on load.  My problem is that when I click that
[quoted text clipped - 37 lines]
>    
> End Sub
 
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



©2008 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.