Chad-

Hmmm.  You can't really update an AutoNumber field, so AfterUpdate won't
ever fire.  But I tested it and Change doesn't fire either.  You could set
it in the form's BeforeUpdate event to set the Client_ID just before Access
saves any changed record.

Is the Customers form still open when Jobs is open?  If so, my code in the
form's BeforeUpdate should work.  I assumed the other form might be named
"frmCustomer" - you'll have to change that to the actual name of the form.

John Viescas, author
"Building Microsoft Access Applications"
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
 

-----Original Message-----
From: ms_access@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of chadcbc
Sent: Wednesday, November 09, 2005 5:37 PM
To: ms_access@yahoogroups.com
Subject: [ms_access] Re: auto enter value

John,

I had used the change event because the job ID is an autonumber so the event
would only fire once, I believe. Regardless, I changed it to afterupdate(for
good habits). However, the code you provided did not solve my problem. The
jobs form is opened from a button in the customers form. The jobs form does
not contain the field Client_ID(it is only used to sort the jobs under each
client). Here I see all the jobs for the selected client. When I enter a new
job I would like the form to notice the specific Client_ID selected in the
parent form and write this into the Client_ID field in the Jobs Table.
Hopefully this information can help further explain my problem.

Thanks,
Chad

--- In ms_access@yahoogroups.com, "John Viescas" <[EMAIL PROTECTED]> wrote:
>
> Chad-
> 
> Why use the Change event?  That fires with each character typed in
Job_ID.
> Consider using AfterUpdate instead.  Where is the Client_ID value - in 
> another form?  If so, the syntax should be more like:
> 
>    Me.Client_ID = Forms!frmCustomers!Client_ID
> 
> John Viescas, author
> "Building Microsoft Access Applications"
> "Microsoft Office Access 2003 Inside Out"
> "Running Microsoft Access 2000"
> "SQL Queries for Mere Mortals"
> http://www.viescas.com/






------------------------ Yahoo! Groups Sponsor --------------------~--> Get
Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links



 







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ms_access/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to