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 / Modules / DAO / VBA / April 2008

Tip: Looking for answers? Try searching our database.

acDialog not working properly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cyberwolf - 04 Apr 2008 20:39 GMT
I have the following code that opens as many as 5 different forms based on
the selected items in the list box.  It does not stop code execution on each
form open, it just opens all of the forms at the same time.  

Private Sub cmdOpen_Click()
Dim varItem As Variant

  On Error GoTo cmdOpen_Click_Error

   Me.Visible = False
   For Each varItem In Me.lstSegTables.ItemsSelected
      DoCmd.OpenForm (Me.lstSegTables.ItemData(varItem)), acFormDS, , ,
acFormAdd, acDialog
   Next varItem
   Me.Visible = True
   
  On Error GoTo 0
  Exit Sub

cmdOpen_Click_Error:

   MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
cmdOpen_Click of VBA Document Form_Form1"
End Sub

Also, the forms do not open properly.  In this I meam the do not open like
other forms I have set to open with acDialog.   They open very small.  All
you can see is the "X" used to close and part of the 1st field in the form.

Any help would be appreciated.

TIA,

Signature

James B Gaylord
From the Wolf Comes the Strength of the Pack
From the Pack Comes the Strength of the Wolf
                                                    - R Kipling

Albert D. Kallal - 04 Apr 2008 21:31 GMT
As far as I know, You can't open a form in datasheet mode, and have a
dialogue it the same time....

You'll likely have to make the forms continuous forms.

if you absolutely must use data sheets, then you're gonna have to have the
close event of the datasheet call your code to launch the next form, as
you'll not be able to have the calling code "wait" by using a dialog
form....

Perhaps a better approach would be to display all the forms in a list box on
a form. This would allow the user to click on each entry in the list box to
launch the form in datasheet mode, and then when they close that form, they
would be back at this form with the listed box to select the next form they
are supposed to operate on.

Signature

Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com

David W. Fenton - 05 Apr 2008 05:20 GMT
> As far as I know, You can't open a form in datasheet mode, and
> have a dialogue it the same time....

But you can open a form in dialog mode that has a subform on it that
is in datasheet mode. The main form would be unbound and serve no
purpose other than to allow you to open the datasheet form modally.

Signature

David W. Fenton                  http://www.dfenton.com/
usenet at dfenton dot com    http://www.dfenton.com/DFA/

Cyberwolf - 07 Apr 2008 14:53 GMT
I had a feeling that was wht it was, but hey you never know until you ask.

Thanks Albert.  BTW, I have used a lot of the suggestions from your site.
Great stuff!!!

>As far as I know, You can't open a form in datasheet mode, and have a
>dialogue it the same time....
[quoted text clipped - 11 lines]
>would be back at this form with the listed box to select the next form they
>are supposed to operate on.

Signature

James B Gaylord
From the Wolf Comes the Strength of the Pack
From the Pack Comes the Strength of the Wolf
                                                    - R Kipling

Linq Adams - 04 Apr 2008 22:11 GMT
DoCmd.OpenForm (Me.lstSegTables.ItemData(varItem)), acFormDS, , ,
acFormAdd, acDialog

The problem is you're trying to open your forms in both Datasheet mode and
Dialog mode, and Access doesn't allow this. When you open forms in Datasheet
mode you give up much of the normal functionality allowed forms. In Design
View, for instance, you can do all kinds of formatting things, add unbound
controls and such, and when you open the form in Datasheet view (acFormDS)
all these things disappear. Since you're opening these form in DS view, the
acDialog idn't really invoked, and the code in the original form is not
suspended  as it normally would be.  

I'm not sure, but the problem with all of the forms opening small could be
related to this also. Opening five forms at once seems, in itself, rather
strange.

Signature

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

Answers/posts based on Access 2000/2003

 
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.