Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Date on the fly query 1

Status
Not open for further replies.

Xenocide

Programmer
Jan 20, 2005
76
CA
Hi I wanna insert that in my table

strSQL4 = "INSERT INTO Date850([Date], [IdEngagementA], [Depense]) " & _
"VALUES ('X','" & lst2.Value & "','" & txt2.Value & "') ;"

The first value, X, is suppose to be the date of the day.
Is there a way to get the date on the computer and insert it in the database with an insert like mine?

What should be the inputmask of the date date in the database? I used the short date one
 
strSQL4 = "INSERT INTO Date850([Date], [IdEngagementA], [Depense]) " & _
"VALUES (#" & Format(Date, "yyyy-mm-dd") & "#,'" & lst2.Value & "','" & txt2.Value & "') ;"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
thanks a lot

is there a way to do the same but in a Query instead of a onthefly one
 
Yes:
INSERT INTO Date850 ([Date], IdEngagementA, Depense)
VALUES (Date(), [Forms]![mainform name]![lst2], [Forms]![mainform name]![txt2])


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top