acDialog - Form Invisible?

Discussion in 'Access VBA Modules' started by Faraz Ahmed Qureshi, Jun 1, 2010.

  1. ACCESS2007

    The code was working well:

    Private Sub Login_id_NotInList(NewData As String, Response As Integer)
    On Error GoTo NtInList_Err
    Dim intAnswer As Integer
    intAnswer = MsgBox("The login ID " & Chr(34) & NewData & _
    Chr(34) & " is not currently listed." & vbCrLf & _
    "Would you like to add it to the list now?" _
    , vbYesNo, "BC")
    If intAnswer = vbYes Then
    DoCmd.OpenForm "User", , , , acFormAdd, acDialog
    Form_User.Login_id = NewData
    Response = acDataErrAdded
    Else
    MsgBox "Please choose a name from the list." _
    , vbInformation, "BC"
    Response = acDataErrContinue
    End If
    NtInList_Exit:
    Exit Sub
    NtInList_Err:
    MsgBox Err.Description, vbCritical, "Error"
    Resume NtInList_Exit
    End Sub

    But now the FORM "USER" doesn't appear and the database seems to be hanged.
    However, upon Tab, the field names seem to be appearing on the bottom bar?
    --
    Thanx & Best Regards,

    Faraz!
     
    Faraz Ahmed Qureshi, Jun 1, 2010
    #1
    1. Advertisements

  2. On Tue, 1 Jun 2010 00:11:01 -0700, Faraz Ahmed Qureshi
    <> wrote:

    I doubt that very much. What you are attempting to do is to first open
    form User in dialog mode, then on the next line set the Login_id. That
    next line won't run until AFTER the form closes, so it is not a good
    way to pass information to the form. Use the OpenArgs argument of
    DoCmd.Openform instead.
    Secondly acFormAdd depends on several conditions. For a test remove
    this argument. Also check that the form uses an updatable recordset
    (if not, can't acformadd, right?) and that the form's AllowAdditions
    property is set to True.

    -Tom.
    Microsoft Access MVP


    >ACCESS2007
    >
    >The code was working well:
    >
    >Private Sub Login_id_NotInList(NewData As String, Response As Integer)
    > On Error GoTo NtInList_Err
    > Dim intAnswer As Integer
    > intAnswer = MsgBox("The login ID " & Chr(34) & NewData & _
    > Chr(34) & " is not currently listed." & vbCrLf & _
    > "Would you like to add it to the list now?" _
    > , vbYesNo, "BC")
    > If intAnswer = vbYes Then
    > DoCmd.OpenForm "User", , , , acFormAdd, acDialog
    > Form_User.Login_id = NewData
    > Response = acDataErrAdded
    > Else
    > MsgBox "Please choose a name from the list." _
    > , vbInformation, "BC"
    > Response = acDataErrContinue
    > End If
    >NtInList_Exit:
    > Exit Sub
    >NtInList_Err:
    > MsgBox Err.Description, vbCritical, "Error"
    > Resume NtInList_Exit
    >End Sub
    >
    >But now the FORM "USER" doesn't appear and the database seems to be hanged.
    >However, upon Tab, the field names seem to be appearing on the bottom bar?
     
    Tom van Stiphout, Jun 1, 2010
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Ashu
    Replies:
    1
    Views:
    140
    Karl Henning
    Nov 16, 2004
  2. Pele
    Replies:
    16
    Views:
    138
  3. Leif

    acDialog in Openform not working with acFormDS

    Leif, Oct 5, 2007, in forum: Access VBA Modules
    Replies:
    7
    Views:
    387
    David W. Fenton
    Oct 6, 2007
  4. Cyberwolf via AccessMonster.com

    acDialog not working properly

    Cyberwolf via AccessMonster.com, Apr 4, 2008, in forum: Access VBA Modules
    Replies:
    4
    Views:
    218
    Cyberwolf via AccessMonster.com
    Apr 7, 2008
  5. Tara

    Visible/Invisible based on form status

    Tara, May 21, 2008, in forum: Access VBA Modules
    Replies:
    3
    Views:
    92
    Paolo
    May 22, 2008
  6. David H

    Return a value from a form opened as acDialog

    David H, Feb 20, 2009, in forum: Access VBA Modules
    Replies:
    7
    Views:
    162
    Marshall Barton
    Feb 24, 2009
  7. MikeF

    Form group invisible by field criteria

    MikeF, Apr 15, 2009, in forum: Access VBA Modules
    Replies:
    11
    Views:
    115
    Jack Leach
    Apr 16, 2009
  8. Jack Leach

    acDialog form won't accept mouse input?

    Jack Leach, Aug 27, 2009, in forum: Access VBA Modules
    Replies:
    7
    Views:
    153
    Dirk Goldgar
    Aug 28, 2009
Loading...