Hi there..
thanks for the reply.. I actually solved the issue with the date by, as
you
said, putting =Date() into the table field as default. But the same
does
not
work for
=DLookUp("Provider","ORP Matrix","[no] =" & Forms![Referrals ORP]!ID)
as I said, on the form, this is in control source, but cannot put it
into
table as default. the issue might be that even on the form this comes
up
with error as at the beginning until an autonumber is allocated for ID.
Once
any field is entered ID is allcoated and dlookup works and puts the
data I
want. But on the table I guess this does not work. I need a way to
update
the
table field after the data entry. Is that possible or should I do
something
so that let's say every night the data is updated? How can I do that?
thanks for your help
Simon
:
simon,
Say that your using the DLookup for a table field named
[SomeValue]
It sounds like you're creating calculated fields, where the
Control
Source
of the control is not bound to any table field. Example
ControlSource...
= Dlookup(some field, some table, some criteria)
That may "display" the correct value... but Access has no way of
knowing
what table field that value was intended for. You need to "bind" the
control
to a table field. The ControlSource should be...
[SomeValue]
Now, on some event in the subform, by Macro or Event Procedure you
would
code to update the value of the "bound" [SomeValue] control on the
form.
ex.
Me.SomeValue = DLookup(some field, some table, some criteria)
------------
The same applies to your Date field (ex. [DOC] (Date of Creation))
ControlSource = Date()
That "displays" the correct date, but does nothing to update [DOC]
in
your
table.
In this case, binding the field... to ControlSource...
[DOC]
and setting the DefaultValue of [DOC] to...
=Date()
will update [DOC] with the current Date whenever a new subform record
is
added.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your
life."
I created a form for data entry based on a table. One of the fields
on
the
form generates data though dlookup from another table. On teh form
all
looks
OK, but that data does not appear in the field on the table.
Actually
same
happens with data field on teh form. I used Date() so that on teh
fporm
the
date is genarated automatically, but date does not appear on teh
table.
What am I doing wrong and how can I fix it?
thanks