Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 December 28th, 2013, 01:05 PM
Registered User
 
Join Date: Dec 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Opening a new form, carrying a data element from the previous form

I'm developing an application where I am I have a data set of clients, and then complete survey processes with this set. My goal currently is to launch the survey from within the client record, so I'm doing a OpenForm command and am trying to carry the Client ID number to the form that is opening, so far without luck.

Can anyone help me with this?
 
Old December 31st, 2013, 12:35 AM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

Here are the two ways I pass data:

1) Push

a) You can use the OpenArgs parameter of the DoCmd.OpenForm to pass pus the data to the form it opens. When the other form opens use the Form's On Load or On Current event, depending on your app's design, to retrieve the Me.OpenArgs property and assign it to something.

b) use the DoCmd.OpenForm Where parameter to filter the data on the fomr that opens.

2) Pull

In the form that opened with DoCMd.OpenForm, use the Form's On Current or On Load event, depending on your app's design, to retire the data from the original form used a form reference to the control with the value.

Example: Me.txtSurveyClientID = Forms!Clients.txtClientID
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem adding element to the previous element dani1 XSLT 5 September 10th, 2008 01:38 AM
submit form and jump on previous page sanjeev jha Classic ASP Basics 0 November 3rd, 2007 06:18 AM
Closing a form after opening another form rosebushr Access 2 January 7th, 2006 04:34 AM
using Result form previous column... filipczako SQL Language 4 November 28th, 2005 05:41 PM





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