form questions

B

bbypookins

How do I get a three digit text field to always have leading zeros? In other
words, for record one I want it to be 001 instead of just 1.

Also, I need to create a data entry log. Each time someone enters or changes
data to a record I need it logged into a table. I don't want it to overwrite
itself each time. I've created a table to store the inforamation with the
following fields: UserID; TimeStamp; DateStamp. How do I get this to work?
Also, is there a way to indicate what fields inthe form they modified? If
not, that's okay. Thanks.
 
B

bbypookins

Thanks, I'll work on the log.

As far as the leading zeros, I have the format set as 000, but it's still
not working. The field (SeqNumber) is automatically generated using the
following code. Can it be modified to make it three digits?

Private Sub Division_AfterUpdate()
With Me
.SeqNumber = Nz(DLookup("[SeqNumber]", "tblRPALog", "[Division] = """
& .Division & """"), 0) + 1
End With
End Sub
 
K

Klatuu

Private Sub Division_AfterUpdate()
With Me
.SeqNumber = Format(Nz(DLookup("[SeqNumber]", "tblRPALog",
"[Division] = """
& .Division & """"), 0) + 1,"000")
End With
End Sub

--
Dave Hargis, Microsoft Access MVP


bbypookins said:
Thanks, I'll work on the log.

As far as the leading zeros, I have the format set as 000, but it's still
not working. The field (SeqNumber) is automatically generated using the
following code. Can it be modified to make it three digits?

Private Sub Division_AfterUpdate()
With Me
.SeqNumber = Nz(DLookup("[SeqNumber]", "tblRPALog", "[Division] = """
& .Division & """"), 0) + 1
End With
End Sub


Klatuu said:
Here is a link to a site where you can get everything you need to use an
audit log:

http://www.allenbrowne.com/AppAudit.html

As to the leading zeos. Use the control's Format property just type in 3
0's, no quotes:
000
 
Top