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 October 7th, 2007, 04:01 AM
Authorized User
 
Join Date: Dec 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default On Exit event Problems

I have one main form and one sub form the main form is related to main table and sub form is they have two tab control one is family details another is Dues details In main table Eno is (PK) Family table, Dues table related to main table I write the In main form one field on Exit event is below like
Private Sub cmbCF_Exit(Cancel As Integer)
DoCmd.OpenForm ("subFrm1")
End Sub
Now problems is In Main form when I exit the field the subFrm1 always show the first records details actually I want when I change next records in main form the subFrm1 should show the next records in Family, Dues table details How should write the code and what event to be write



Mohamed Mohiddin
Officer
__________________
Mohamed Mohiddin
Officer
 
Old October 8th, 2007, 05:11 AM
Authorized User
 
Join Date: Jun 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mohiddin52
Hi

I am not sure why you want to write special code to link the Dues Detail form to the Main form

If the sub forms record source is the related dues table then you should "embed" the sub form in the main form.

Just drag the sub form on to the main form in Design view and follow instructions.

It is then only necessary to find the Named Person in the Main form and all of the "Dues Details" will be shown in the sub form

The sub form should be in most cases preferably in tabluar layout

Hope this helps



 
Old October 9th, 2007, 07:04 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Also, if you go to the sub form's Properties dialog box when it is in design view and in the main form, select the Data tab and then click in the Link Child Fields, Link Master Fields lines, and make sure the FK in the SubForm is matched to the FK in the main form. This should keep them synchronized.

Did that help?

mmcdonal
 
Old October 9th, 2007, 12:47 PM
Authorized User
 
Join Date: Jun 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I should have said in my previous post that in order to embed the subform in the main form I was assuming that you would (while in design view) Click on tools and click on tile vertically which allows you to view all of your other forms.

The click on Tools ensuring that the wizard was activated Hhen this has been done drag the sub form to the main form this will activate the wizard then follow the instructions.

Otherwise take previous posting advice to link the Primary and Foreign Keys in the properties of the form

Please advise if this has solved your problem

Man Friday










Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Image Handler Click Event daniel.mihalcea C# 2008 aka C# 3.0 12 March 12th, 2010 06:29 AM
on exit mohiddin52 Access VBA 2 July 10th, 2007 09:28 AM
exit from for-each preethi.s XSLT 1 September 8th, 2006 05:37 AM
Problems with Body onload event blaabil Javascript How-To 0 January 6th, 2006 06:45 AM
Problems Using BeforeUpdate Event salating Access VBA 3 September 7th, 2005 07:29 AM





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