Hi ladybug,
one easy to do this doesn't use a query at all.
Open the table dbo_sds_dir_route in design view and go to the field
RouteDateCr.
Set the default value for this field to Now()
Every time a new record is added to the table, the current date and time
will automatically appear in RouteDateCr.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"ladybug via AccessMonster.com" <u21071@uwe> wrote in message
news:9a0e50394c940@uwe...
> Currently I have a form called "frm_routing_new" with a combo box called
> "queuecd". Users make a selection and then clicks button "btn_submit."
> The
> On Click Event has the following code:
>
> DoCmd.RunSQL ("INSERT INTO dbo_sds_dir_route (DIRId, QueueCd, OrderNo,
> RouteComp) SELECT [FORMS]![frm_routing_new]![DIRId],
> [FORMS]![frm_routing_new]
> ![QueueCd], iif(isnull(a.maxOrderNo),0,a.maxOrderNo)+1, ""N"" FROM (SELECT
> max(OrderNo) as maxOrderNo FROM dbo_sds_dir_route WHERE DIRId = [FORMS]!
> [frm_routing]![DIRId]) a;")
> DoCmd.Close
> [Forms]![frm_routing]![sfrm_route_work_outs].Requery
>
> Now I have created a new field called "RouteDateCr" to table
> "dbo_sds_dir_route." I would like when "btn_submit" is clicked, the
> current
> date and time is entered in table "dbo_sds_dir_route" Can someone help me
> modify the code above to make this occur? Thank you in advance!
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...oding/200908/1
>