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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Button to Update a Field

Status
Not open for further replies.

jazbar

Technical User
Apr 26, 2006
37
GB
Hi All

I'm using MS Access 2003 and have created an autoform from a querie. On the form is a text box called Closed Date that links to a field called Closed Date in a table called Table1.

I have created a Command Button called Close. What I want to happen is for the user to be able to click on the Close button and for the Closed Date text box to display todays date and then update the Closed Date field in Table1.

I've managed to get the first part to work, in that clicking the button will make the text box Closed Date display todays date, but it doesn't update the Closed Date field in Table1, and the Closed Date text box will still show todays date if you use the navigation buttons to display the next record in the database.

I want the user to be able to update the Closed Date field in Table1 for the record they are viewing at the time and not any others.

The Event Procedure I have in place at the moment for the Close button is below:

Private Sub Close_Click()
[Closed Date] = Date
End Sub

It would be great if anyone could help me find the solution.

Thanks in advance

jazbar.
 
Are you sure that your TextBox is bound to the field ?
Anyway, it's not a good idea to have controls with the same name than fields.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV. You're right, for some unknown reason the field was unbound. I can't understand why that would have happened but thanks, all's well that ends well!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top