Rabu, 23 Desember 2015

Re: [MS_AccessPros] Please help with VBA code

 

If it's opening in Add mode, then that must be the default for the form as designed.  I you want to open to edit, do:


    DoCmd.OpenForm, "Liquor", DataMode:=acFormEdit

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Dec 23, 2015, at 8:26 PM, kenaf42@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Access 2010. I use the following code to open a form from another form

Private Sub PayFor_AfterUpdate()
 
 Select Case Me.PayFor
        Case "Liquor"
            ' Open related form
            DoCmd.OpenForm "Liquor"

This works fine but always opens the second form in ADD mode.

How can I add instruction to above code to open a form in either ADD or Edit mode?



__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar