Dates in Combo Boxes

A

aputt

Whenever a user makes a change to a record in the
database, I capture the user's login name from the OS and
also the date. I then use combo boxes 1 of which displays
the users and another one that displays the dates. The
because of the dates being stored in the table as data and
time I get numerous date entries in my combo box using the
SELECT DISTINCT. How can I have the date saved in the
table with only the date portion withour using an update
query?

I want to use the date and user name to generate a report
of changes that were made. Of course the date portion in
the query does not work because of the date and time in
the table.
 
G

Guest

hi,
the combo box is displaying ALL dates in the table. each
time a new and distinct date is entered, your select
statement picks it up. that is what combo boxes are
for...to show all available selection options. it does not
show individual records.

If you wish to show the date of the record, then you need
to change the combo box to a text box.
 
J

John Vinson

Whenever a user makes a change to a record in the
database, I capture the user's login name from the OS and
also the date. I then use combo boxes 1 of which displays
the users and another one that displays the dates. The
because of the dates being stored in the table as data and
time I get numerous date entries in my combo box using the
SELECT DISTINCT. How can I have the date saved in the
table with only the date portion withour using an update
query?

I'm not clear why you have these combo boxes at all! If you want to
save the userID and date (or date/time) in the table, it's not
necessary to present a combo box - or even the fact that this is
happening - to the user. You can simply use the Form's BeforeUpdate
event to push the UserID and either Date() or Now() into the field:

Private Sub Form_BeforeUpdate(Cancel as Integer)
<any record validation code goes here>
Me!UxerID = <the user ID, from a Form or function call>
Me!Timestamp = Now
End Sub


John W. Vinson[MVP]
(no longer chatting for now)
 
S

SteveS

aputt said:
Whenever a user makes a change to a record in the
database, I capture the user's login name from the OS and
also the date. I then use combo boxes 1 of which displays
the users and another one that displays the dates. The
because of the dates being stored in the table as data and
time I get numerous date entries in my combo box using the
SELECT DISTINCT. How can I have the date saved in the
table with only the date portion withour using an update
query?

I want to use the date and user name to generate a report
of changes that were made. Of course the date portion in
the query does not work because of the date and time in
the table.

FYI,

Me!timestamp = Now 'returns the date and time.

Me!timestamp = Date 'returns only the date

HTH
 

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