Wrox Programmer Forums
|
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 June 16th, 2006, 06:42 AM
Authorized User
 
Join Date: Jun 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Automatic Entries on Forms

I have a main form with a subform for which the number of weeks field is filled in each time with the same amount as each new record is added.

I have created an unbound text box called weeks where the user will enter a figure, I would then like to be able to add this figure to the new record created on the subform.

I have tried using an on current event on the sub form:

dim vName as Variant
vName = Me.weeks
Forms!Sales_Subform!Number_of_Weeks = vName

It doesn't seem to work - any ideas

Many thanks

Taraj

 
Old June 16th, 2006, 07:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

If you are on the SUBform's On Current event, then you need

Me.Number_of_Weeks = Me.Parent.Weeks

If Weeks is on the main form and Number_of_Weeks is on the subform.



Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old June 16th, 2006, 07:37 AM
Authorized User
 
Join Date: Jun 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Many thanks for your help - worked first time !

TaraJ






Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing duplicate entries avantikad XSLT 2 January 2nd, 2008 12:29 PM
Delete Blog Entries Tawanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 January 27th, 2007 03:53 PM
counting unique entries Figgis Access 5 November 23rd, 2005 07:01 PM
Forms and Database Entries hcweb Classic ASP Basics 3 June 4th, 2004 10:11 AM





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