Results 1 to 4 of 4
  1. #1
    ACM is offline Novice
    Windows Vista Access 2007
    Join Date
    Oct 2009
    Posts
    1

    Question about Form

    I was wondering how I go about making my form functional.



    Okay, so I have an exit button, which doesn't work. Even though the code looks good to me. I want the form to close when the user clicks exit.

    Code:
    Private Sub Command5_Click()
    Unload.Me
    End Sub
    I have a button which is meant to take the user to another form, a complaints form where they can fill out a complaint. I've managed to do this by using a hyperlink but I can't seem to find a way of doing it by using VBA code. Does anybody know?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Instead of Unload.Me try DoCmd.Close acForm, Me.Name, acSaveNo

  3. #3
    dbDamo is offline Novice
    Windows XP Access 2000
    Join Date
    May 2009
    Posts
    10
    These are simple commands that you can create using the command button wizard. When you drop a command button onto your form in design view this wizard displays automatically, just scroll through all the options. Its really quite simple to use.

    If your intention is to learn VB and stop using the wizard then I apologise.

    To open a form, place this code in the OnClick event of your command button -

    DoCmd.OpenForm "YourFormNameHere"

  4. #4
    Join Date
    Oct 2009
    Location
    Bromsgrove, West Midlands, England
    Posts
    13
    A slightly abreviated version of Allans code to close the current form.

    Code:
     
    Docmd.close , ""

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Question about entering data through form
    By vixtran in forum Database Design
    Replies: 6
    Last Post: 06-16-2009, 07:23 AM
  2. Question on Northwind catagories form
    By Icedog in forum Access
    Replies: 1
    Last Post: 09-25-2008, 08:10 AM
  3. Form Event Question
    By protean_being in forum Forms
    Replies: 3
    Last Post: 05-06-2008, 10:43 AM
  4. Replies: 1
    Last Post: 02-27-2006, 07:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums