Call Dates from a Table

P

PR

I am trying to set up a routine that allows me to set dates when a form is
open up...

I have a table called tbl_ROD, which has 2 fileds held in it AGA_ROD and
AWSA_ROD, what I would like to do is set this date on the form when update to
one of these dates...

Can anyone help me...
 
J

Jeanette Cunningham

Hi PR,

If you are asking how to set a default date for a date text box when the
form opens, you can do it like this.

In the load event of the form:

Me.[NameOfDateControl].DefaultValue = "#" & DLookup("{AGA_ROD]", 'tbl_ROD")
& "#"


When the form opens, the date in the text box will be the value of the date
in field AGA_ROD in the table.
Note I am assuming that tbl_ROD has only one record, and that there is only
one possible value for AGA_ROD.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
P

PR

Jeanetta,
there are two fields in the table called "AGA_ROD and AWSA_ROD" there are
only one value in each... is this ok?

PR

Jeanette Cunningham said:
Hi PR,

If you are asking how to set a default date for a date text box when the
form opens, you can do it like this.

In the load event of the form:

Me.[NameOfDateControl].DefaultValue = "#" & DLookup("{AGA_ROD]", 'tbl_ROD")
& "#"


When the form opens, the date in the text box will be the value of the date
in field AGA_ROD in the table.
Note I am assuming that tbl_ROD has only one record, and that there is only
one possible value for AGA_ROD.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


PR said:
I am trying to set up a routine that allows me to set dates when a form is
open up...

I have a table called tbl_ROD, which has 2 fileds held in it AGA_ROD and
AWSA_ROD, what I would like to do is set this date on the form when update
to
one of these dates...

Can anyone help me...
 
J

Jeanette Cunningham

Yes, this is OK.
I am assuming that AGA_ROD contains a date when you open the table in data
sheet view, and a similar thing for AWSA_ROD.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria AustraliaIs each
value a date?


PR said:
Jeanetta,
there are two fields in the table called "AGA_ROD and AWSA_ROD" there are
only one value in each... is this ok?

PR

Jeanette Cunningham said:
Hi PR,

If you are asking how to set a default date for a date text box when the
form opens, you can do it like this.

In the load event of the form:

Me.[NameOfDateControl].DefaultValue = "#" & DLookup("{AGA_ROD]",
'tbl_ROD")
& "#"


When the form opens, the date in the text box will be the value of the
date
in field AGA_ROD in the table.
Note I am assuming that tbl_ROD has only one record, and that there is
only
one possible value for AGA_ROD.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


PR said:
I am trying to set up a routine that allows me to set dates when a form
is
open up...

I have a table called tbl_ROD, which has 2 fileds held in it AGA_ROD
and
AWSA_ROD, what I would like to do is set this date on the form when
update
to
one of these dates...

Can anyone help me...
 
Top