SteveL13
asked on
INSERT VBA code
I have a subform with 10 date fields on it. And I want to insert the values of those dates fields into a table named tblDeliverydates using INSERT. This isn't right. Can someone help?
Note: If it matters, sometimes one or more if the date fields may be empty.
Dim DeliveryDate As Date
INSERT INTO tblDeliveryDates (DeliveryDate) VALUES (DelDate1, DelDate2, DelDate3, DelDate4, DelDate5, DelDate6, DelDate7, DelDate8,ReskedDate9, ReskedDate10)
Note: If it matters, sometimes one or more if the date fields may be empty.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Any time you use a number like this in a field name, it is a good indication that you have a poor table design. Instead of 10 columns like this, you should have a separate table which contains the PK from the main record, and then maybe a SeqNum field (with values 1-N), and the DelDate (date) column.
Then you could display this data in a bound subform, rather than an unbound form. And it would also be easier to retrieve or analyze the data than with 10 separate columns.
Dale