setting a number to a field which starts at 1 on a new day.

F

FBrnstrmr

So when I begin to add records on any given day the number of this field
starts at 1
and increments by 1 until I have finished entering records for that day. Any
suggestions on how to do that please? Thanks very much,
-Fred
 
P

Piet Linden

So when I begin to add records on any given day the number of this field
starts at 1
and increments by 1 until I have finished entering records for that day. Any
suggestions on how to do that please? Thanks very much,
-Fred

use DCount() and use the date as your criterion
 
F

FBrnstrmr

Thanks Piet, I tried that [DCount(InspectionDate)] in both the Table default
field as well as the form default field but "the expression I entered has a
function containing the wrong number of arguments."
 
F

FBrnstrmr

Well I figured that part out, but it turns out I need to DCount ased on 2
criteria, the date as well as the address location associated with the
record. How do I get the DCount to start a new count when I change the
location on the same date.
The location is in a form and the dcount # is in a subform of that form. as
are the Tables a parent child situation.
Thanks very much,
-Fred
 
S

Steve

How about if you add a field named "Timestamp" to your table and set its
Default Value to Now(). Then add this field to your form but make it
invisible. Every time you enter a record, the current date and time will be
recorded in this field. Then when you want to display your records in a form
or report, use a query for the record source and sort on "TimeStamp".
Sorting ascending will list your records in the order they were entered and
sorting descending will list your records in the reverse order they were
entered.

Steve
(e-mail address removed)
 
F

FBrnstrmr

Thanks Steve, I already have a timestamp which I am using for part of the
requiremenst but there is a location element as well. The subform is being
used to create records on a certain date and hence is time stamped but the
records of the subform are associated with the main form which tracks
addresses that means I need to number each subform record according to both
the subform date as well as the form's address. This means each time I change
the address I need the subform record numbers to be reset to 1 and increment
for each record added to the same address for that date.
 
S

Steve

Create a query that includes the table that contains the addresses entered
in the main form and the table that contains the Timestamp from the subform.
Pull the address and the timestamp into fields in your query. Set the sort
on the timestamp field as I described in my first response. The query will
return an address one by one and for each address will return a list of the
records for that address sorted as you set.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top