Opening one form and then another based on value in the first

prmitchell

Registered User.
Local time
Today, 22:22
Joined
Jan 2, 2013
Messages
58
Hi
I have two tables where one Client has many jobs - and I have a switchboard with a combo box showing the existing clients where the user selects a client and then opens a Jobs form to enter a new job (Add mode) and so the user types in the details of the job but naturally I want the job form to record the clientID (in the Jobs table).
So after the user enters a job name (first field in the jobs form) I have an event on AfterUpdate which is
[ClientID].Value = Forms!Menu![ClientID].Value
Forms![Jobs].Refresh
DoCmd.Save acForm, "jobs"

This works fine for me using 2010 - every time - but I give to a user who is using 2007 - and it doesn't work every time.

Do I need all three lines, do I need something else, doe I need something different? Can you do this for when the form opens rather than when the user types in a job name (AfterUpdate)?


alternatively I have tried using the where condition on opening a form, namely
"[ClientID]=" & "'" & [ClientID] & "'"
but this doesn't work for add data mode, or does it somehow?

Peter
 
Thank you Pat, much appreciated.
I have also found in addition to your advice is to also include the SaveRecord method on the button on the first form that activates the second form opening.

Touch-wood, all working now.
 

Users who are viewing this thread

Back
Top Bottom