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

VBA Recordset update problem help required please

Status
Not open for further replies.

EmanuelSpence

IS-IT--Management
Apr 26, 2010
34
GB
I am in a current form

The Table is called 'Short Time Working'

The current record is 'ShortTimeID'

and I want to update the value of field 'Week Number' to 67 when i press the command button

What am i doing wrong ?

Dim Tn As DAO.Recordset

Set Tn = CurrentDb.OpenRecordset("SELECT * FROM [Short Time Working] WHERE ShortTimeID =" & Me.ShortTimeID)
If Not Tn.EOF Then
Tn.Edit
Tn.Fields("Week Number").Value = 67

Tn.Update
End If
Tn.Close
Set Tn = Nothing
 
What you are doing wrong is not telling us what happens when you "press the command button". We can't see all of your code or your results. There is an FAQ in this forum about how to debug your code. Please read this and respond back if you have any questions.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top