Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie needs help with query

Status
Not open for further replies.

oldmandtr

Technical User
Jul 28, 2002
3
US
I have a table set up and in it I show when a product is completed (using drop down list).
Is there a way some one can tell me how to make the completed in that field show the current date in another field (automatically) for tracking purposes.
Any help appericated.
 
Hi,

If I understand you correctly, you want to run a query that will change the date field to the current date for every product record that has been completed?

OR

Do you have a form in which the user will select: Complete or not complete from a dropdown and whene complete is
selected assign the current date to the date field.

For the form approach:

Insert this code into the dropdown AfterUpdate event.
cboCompleted and txtDateCompleted are bound controls to your table.

Private Sub cboCompleted_AfterUpdate()
If cboCompleted Then
txtDateCompleted = Date
Else
txtDateCompleted = ""
End If
End Sub

For the query approach:

'Execute this query to assignt he current xate for all completed products. Change the field names etc as needbe.

"UPDATE tblProduct SET dtDateCompleted=date() WHERE ynCompleted=Yes"

Have a good one!
BK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top