acdialog/Modal Windows & Access 2007

H

Heather

I am trying to do something I've done a hundred times in previous version of
Access & can't get to work in 2007. I am trying to code a form pop-up when I
trigger a "not in list" error. I have tried my standard acdialog setting for
the docmd.openform command (see code below), I have also tried to manually
set the default of the pop-up form to modal & regardless I can't get the code
to stop running when the form pops up. I did a quick debug.print me.modal in
the pop-up form & it tells me it's modal (True) when I set the form itself to
modal, but not when it's called from VB using acDialog. To further my
annoyance I can't get the OpenArgs data to transition over either - but I
think the form has to be modal for that also.

Help! Is this a setting somewhere in 2007 that I need to change?

Code:
Private Sub Product_ID_NotInList(NewData As String, Response As Integer)

Dim strFrm As String
Dim strProduct As String
Dim intAnswer As Integer
Dim frmMyForm As Form

Set frmMyForm = Forms!frmOrderDetails
strFrm = "frmProduct"
strProduct = "Product_ID"

intAnswer = MsgBox("Add " & NewData & " to the Product list?", vbQuestion +
vbYesNo)
If intAnswer = vbYes Then
'Open the form to add new products
DoCmd.OpenForm strFrm, acFormDS, , , acFormAdd, acDialog
Response = acDataErrAdded
Me.Product_ID.Undo
Else
Response = acDataErrContinue
End If

End Sub
 
B

boblarson

H

Heather

I was; changed it & it still doesn't work. I continue to also see the
me.modal = false in my debug.print command output.
 
B

boblarson

Sorry, I missed this but are you sure you can call a datasheet as a dialog?
I may be wrong in that but it doesn't sound right to me.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________
 
H

Heather

grrr - you are right! Thanks.

boblarson said:
Sorry, I missed this but are you sure you can call a datasheet as a dialog?
I may be wrong in that but it doesn't sound right to me.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top