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 August 25th, 2007, 01:41 PM
Authorized User
 
Join Date: Aug 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,
I have similar project and looking for a similar solution. So I tried Friday's code and it actually gave me errors! which is big step for me because previous attempts didn't give me any errors, or results...
anyway, when I put the code in the afterupdate section, with my forms' names and fields, this is what I came up with...:
=code=
Private Sub Name_AfterUpdate()

If IsNull(Forms![FIRST-TRANSIT]![CLIENT-Query subform]![Name]) _
And Not IsNull([RECIPIENT NAME]) Then
Forms![FIRST-TRANSIT]![CLIENT-Query subform]![Name] = [RECIPIENT NAME]
End If

End Sub
=end code=
When I run the form, I get "Run-time error '2465': Microsoft Access can't find the field "1" referred to in your expression.
Actually, "1" looks more like straight line, I just don't know how to type that... sorry.

any advice on this? I'd appreciate all you guys' help.
 
Old August 25th, 2007, 03:53 PM
Authorized User
 
Join Date: Jun 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Pari22

I am a bit puzzled about the hyphen between Client and Query

My initial reaction would be to remove the hyphen.

Give me the Names of

MainForm and subform

MainForm Control entry
Subform Control to be copied to

and I will modify my db to suit
then I will get back to you

MF

 
Old August 25th, 2007, 04:43 PM
Authorized User
 
Join Date: Jun 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Pari 22
I have a section of database with a working solution to the problem

Give me an email address and I will send the zipped up file
it is only 159 KB in size

On receipt Open the form PurchOrders and enter a date into the main form exit from the date control by placing the cursor into another control on the main form

The date will be copied to the first line of the sub

If you wish it can be transferred on to both lines but this should be done separately

Place the cursor in the second line of the subform as though you intended to edit the backspace out the date on the main form enter another date and it will be copied to the second line of the sub form.

It is an unusual way to copy date internally but I believe the original request to do it this way was the user was trying to put a Heath Robinson fix on a database they themselves had not designed

Man Friday



 
Old August 27th, 2007, 10:08 AM
Authorized User
 
Join Date: Aug 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ManFriday,
Thank you. You're a gentle soul and a scholar.
Here is the info you requested.
Main form's name: FIRST-TRANSIT, field: RECIPIENT NAME
Sub form's name: CLIENT-QUERY SUBFORM, field: NAME

My goal is to: when/after I change subform's NAME field, I'd like Main form's RECIPIENT NAME to be changed automatically according to subform's value.
So in short, When I search for "John Doe" info at the subform window, I want the main form to display exact Name, phone, ssn... that was searched.
Am I making sense? If not, I could upload a screenshot.
My contact info is: [email protected]
ANY HELP WOULD BE GREATLY APPRECIATED!





Similar Threads
Thread Thread Starter Forum Replies Last Post
unbound field in subform chacquard Access VBA 4 February 7th, 2007 10:01 AM
Fill field based on another field skwilliams Classic ASP Basics 3 December 30th, 2006 11:02 AM
auto fill field mankoti_mankoti2000 Access 1 May 26th, 2006 08:19 AM
MS ACCESS UPDATING A SUBFORM FIELD bernieregans SQL Language 1 February 3rd, 2006 04:26 PM
Filter Subform B Based on Field in Subform A SerranoG Access VBA 3 June 18th, 2004 12:23 AM





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