Results 1 to 4 of 4

Thread: Access vba code form issue

  1. #1
    Join Date
    Jan 2009
    Posts
    30

    Access vba code form issue

    Hello friends,
    I looking for a code which will help me to open a form from a command button.am just not much in to this.so really confused in this regard all am looking is a nice advice or some inputs some like that which will enable me to write the code by myself from a veteran..i googled a lot in internet but i did not find any informative topics..so am putting my post here with confidence

    so please don't neglect me

    any help would be really appreciated...thank you.!!

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Access vba code form issue

    I know a method you have to wrap the Excel commands with the form open and form close commands in the click event of the button on the main form.

    Sub frmMain_Button_Click()

    DoCmd.OpenForm "frm_Progress", acNormal

    .......................
    objExcel.visible = True

    DoCmd.Close acForm,"frm_Progress",acSaveNo

    /now here you can put your own excel commands/

    'End of Excel commands

    just try in this format..may be helpful for you..

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Access vba code form issue

    The code for the command button is
    Docmd.OpenReport ...
    it's a great issue that we it replace with
    Docmd.OpenForm ...
    so don't make such mistakes in the beginning itself.you have an existing data entry form that requires a change in record source? i think you are with a data entry form...
    any way best of luck from my side...

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Access vba code form issue

    Is this you are searching for ?
    Private Sub commandOpenFormAddPostCodeLocalAuthority_Click()
    On Error GoTo Err_commandOpenFormAddPostCodeLocalAuthority_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmAddPostCodeLocalAuthority"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_commandOpenFormAddPostCodeLocalAuth:
    Exit Sub

    Err_commandOpenFormAddPostCodeLocalAuthority_Click:
    MsgBox Err.Description
    Resume Exit_commandOpenFormAddPostCodeLocalAuth

Similar Threads

  1. How to Code a change password form in vb6
    By ronaldobrazil in forum Software Development
    Replies: 2
    Last Post: 23-06-2012, 01:25 PM
  2. Access - form with a dropdown menu
    By Logan 2 in forum Windows Software
    Replies: 5
    Last Post: 21-01-2010, 02:18 PM
  3. How to create access clear button in the form using MS ACCESS
    By T0tal L0$$ in forum Software Development
    Replies: 3
    Last Post: 09-06-2009, 10:59 AM
  4. Form SubForm ACCESS 2007
    By streetprods in forum Software Development
    Replies: 2
    Last Post: 30-05-2009, 03:18 PM
  5. How to connect the web form to Ms Access using ASP.NET?
    By VijayW in forum Software Development
    Replies: 2
    Last Post: 16-02-2009, 09:04 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,837,813.09178 seconds with 17 queries