Dee,
I assume you mean the After Update event - there is no 'After Change'?
While on the topic of terminology, forms don't have fields. They have
controls, which may or may not be bound to a field in the form's
underlying record source table or query.
In the case of your Salesman control, am I correct in my guess that it
is a combobox? And am I correct in my guess that it is unbound? And am
I correct in my guess that the Salesman data is a text data type? If
so, the code might look something like this...
CurrentDb.Execute "INSERT INTO DispoHistory ( ID, Salesman )" & _
" VALUES ( " & Me.ID & ", " & """" & Me.Salesman & """" & " )",
dbFailOnError
Me.FmDispoHistory.Requery
If something like this doesn't do it for you, please post back with
further details, with specific examples.
--
Steve Schapel, Microsoft Access MVP
dee wrote:
> I have a main form "FmLeads".
> It contains a field "Salesman" which has an 'After Change' Event
> Procedure.
>
> The Main form "FmLeads", contains a subform "FmDispoHistory". It
> displays all historic Salesman changes in continuous form format.
>
> It is related to with ONE "FmLeads" record -->> MANY "FmDispoHistory"
> records via an ID field.
>
> I need the Salesman 'After Change' Event Procedure on the main form to
> add a new record to the "FmDispoHistory" subform, and then to assign
> the value of the "Salesman" field from the main form to the "Salesman"
> field in the subform.
>
> Could someone help me with a few lines of VB code that can do tjhis?
> Thank You
>
|