Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 27th, 2006, 09:23 AM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with Forms and records

Hi, I'm trying to open a Form and then in this form start a new record with 1 button.

Thanks for replying n greetz,
blaatje

 
Old May 27th, 2006, 10:18 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

How are you wanting to open the form? Right when you start Access, or fromanother form?

Mike
EchoVue.com
 
Old May 27th, 2006, 10:20 AM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

from another form

greetz,
blaatje

 
Old May 27th, 2006, 10:33 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Alright these are the steps - you may have some of them done already...

1 - You need a table to link the new form to.
2 - Create the new form
3 - Add a button to the new form, and use the wizard to have it create a new record.
4 - On the main form that calls this form, drop a button, and use the wizard to have it open the new form.

Let me know is you want clarification on any part of that.

Mike

Mike
EchoVue.com
 
Old May 27th, 2006, 10:41 AM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Private Sub Knop11_Click()
On Error GoTo Err_Events_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

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

Exit_Events_Click:
    Exit Sub

Err_Events_Click:
    MsgBox Err.Description
    Resume Exit_Events_Click

this is the coding part of going to a form with a button,
what we want now is that that same button also opens a new record in that form (in this cause the form is called 'Events')

greetz,
blaatje


 
Old May 27th, 2006, 10:49 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Nice & easy! Just add to the end of the OpenForm...

DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd



Mike
EchoVue.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
Delete records in MySQL using checkboxes in forms taslim Beginning PHP 2 August 10th, 2006 05:01 AM
Opening forms from other forms Paulsh Access VBA 1 September 30th, 2004 06:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.