From: CJ on
Hi Groupies

I am trying to populate a Date from one subform to another subform
on the same Parent but the field is not populating consistently so I am
trying to force it. I have tried a few things, a couple are below:

I tried this first:

Private Sub lngEmpID_BeforeUpdate(Cancel As Integer)

If IsNull(Me.Parent.txtDefaultDate) And IsNull(Me.dtmDate) Then
Me.dtmDate.Value = Date
ElseIf Not IsNull(Me.dtmDate) Then
Me.dtmDate = Me.dtmDate
Else
Me.dtmDate.Value = Me.Parent.txtDefaultDate
End If

Then I changed the If statement to:

Me.Parent.fsubEmployeeDayCosts.dtmDate.Value = Me.dtmDate.Value

Neither of them are working. Could somebody please
solve this issue for me.
--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
From: tony on
On 17 May, 22:48, "CJ" <priv...(a)newsgroups.com> wrote:
> Hi Groupies
>
> I am trying to populate a Date from one subform to another subform
> on the same Parent but the field is not populating consistently so I am
> trying to force it. I have tried a few things, a couple are below:
>
> I tried this first:
>
> Private Sub lngEmpID_BeforeUpdate(Cancel As Integer)
>
>     If IsNull(Me.Parent.txtDefaultDate) And IsNull(Me.dtmDate) Then
>         Me.dtmDate.Value = Date
>     ElseIf Not IsNull(Me.dtmDate) Then
>         Me.dtmDate = Me.dtmDate
>     Else
>         Me.dtmDate.Value = Me.Parent.txtDefaultDate
>     End If
>
> Then I changed the If statement to:
>
>     Me.Parent.fsubEmployeeDayCosts.dtmDate.Value = Me.dtmDate.Value
>
> Neither of them are working. Could somebody please
> solve this issue for me.
> --
> Thanks for taking the time!
>
> CJ
> ---------------------------------------------------------
> Know thyself, know thy limits....know thy newsgroups!

I had a similar issue to this recently and found that you must
populate the field in the subform that contains the field you wish to
change.

So if your taking the date from subform1 and trying to put it into
subform2 you must pass this date over to subform2 and then populate
it.

I also found that it was best to perform a requery on subform2 so that
the data 'takes' if you get my meaning.

I'm sure one of the Access guru's will be able to explain ii better.
From: CJ on
Hi Tony
Thanks for popping in.

I agree. I think I am just down to needing to requery on the correct event.

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
"tony" <tony.atack(a)googlemail.com> wrote in message
news:4a1377aa-c873-4a60-b350-c6acaba95575(a)o1g2000vbe.googlegroups.com...
On 17 May, 22:48, "CJ" <priv...(a)newsgroups.com> wrote:
> Hi Groupies
>
> I am trying to populate a Date from one subform to another subform
> on the same Parent but the field is not populating consistently so I am
> trying to force it. I have tried a few things, a couple are below:
>
> I tried this first:
>
> Private Sub lngEmpID_BeforeUpdate(Cancel As Integer)
>
> If IsNull(Me.Parent.txtDefaultDate) And IsNull(Me.dtmDate) Then
> Me.dtmDate.Value = Date
> ElseIf Not IsNull(Me.dtmDate) Then
> Me.dtmDate = Me.dtmDate
> Else
> Me.dtmDate.Value = Me.Parent.txtDefaultDate
> End If
>
> Then I changed the If statement to:
>
> Me.Parent.fsubEmployeeDayCosts.dtmDate.Value = Me.dtmDate.Value
>
> Neither of them are working. Could somebody please
> solve this issue for me.
> --
> Thanks for taking the time!
>
> CJ
> ---------------------------------------------------------
> Know thyself, know thy limits....know thy newsgroups!

I had a similar issue to this recently and found that you must
populate the field in the subform that contains the field you wish to
change.

So if your taking the date from subform1 and trying to put it into
subform2 you must pass this date over to subform2 and then populate
it.

I also found that it was best to perform a requery on subform2 so that
the data 'takes' if you get my meaning.

I'm sure one of the Access guru's will be able to explain ii better.