Thanks John,
There are about 400 field numbers. So when I enter data on form, I enter
first record and then I should cycle to new record after entering new
FieldNumber. Then I would have to enter same date again. I don't know if I
understood well.
for example:
Datefield: 15.01.2003
FieldNumber: 001
Value: 155
Then I should move to next record and enter same date in Datefield again.
Also FieldNumber is fix data and not needed to be entered. This is not input
I would like to have.
I would like to enter date once and then enter data in table or tables (if
more for normalisation).
Ok... so have a table of Dates, one record per date (and possibly
other fields if there is any information other than the dates and the
400 field numbers).
Use a Subform based on this three-field table to enter the values; use
the date field as the Master/Child link and it will fill in
automatically.
In the Subform's BeforeInsert event use VBA code such as:
Private Sub Form_BeforeInsert(Cancel as Integer)
Me!txtFieldNumber = NZ(DMax("[FieldNumber]", "[tablename]", _
"[Datefield] = #" & Format(Me![datefield], "mm/dd/yy"))) + 1
End Sub
where txtFieldNumber is the name of the textbox containing the field
number. Set that control's Tab Stop property to False; it will fill in
automatically, incrementing by one for each new record, but you can
mouse into the field to change it if (frex) you have a dataset with
missing data for some field numbers or you get ahead of yourself with
typing.