I am new with VBA programming. I have designed one form in which there is a button. After clicking this button I want to insert record in my table having one date column. Th
Here's a fancy query that will return a month's dates:
SELECT DISTINCT
10 * Abs([Deca].[id] Mod 10) + Abs([Uno].[id] Mod 10) AS Id,
DateAdd("d",[Id], DateSerial(Year(DateOfMonth), Month(DateOfMonth), 1)) AS [Date]
FROM
msysobjects AS Uno,
msysobjects AS Deca
WHERE
(10*Abs([Deca].[id] Mod 10) + Abs([Uno].[id] Mod 10)) < Day(DateSerial(Year(DateOfMonth), Month(DateOfMonth)+1, 0))
That said, I would write a loop adding records to a recordset using VBA, not the slow SQL call of yours.