Update Query: Parameters = Date & Text Field on Form

  • Thread starter Thread starter ryan.paquette
  • Start date Start date
R

ryan.paquette

From a form, I have an update query to update a date field in a
table.
(the form is not based on this table)

Zero records are being updated.
I assume I refered to the controls properly as it is not asking for
any parameters...
The Code on the form is was created by the design wizard.
The SQL in the Query is as follows:

UPDATE tblNext_and_Dates SET tblNext_and_Dates.[Next] = [Forms]!
[frmTraining_Selection]![cboSchDate]
WHERE ((([tblNext_and_Dates].[Training Name])=[Forms]!
[frmTraining_Selection]!Training_Name));


I checked the records on the table to verify the criteria & that's
OK...
I checked the format of the Date field on both the table & the form.
They are both Med.Date.
Any Ideas?

FYI: I'm using Access 2000 SP2.
 
hi ryan,
try this code:
Private Sub UpdateTheDate()
Dim db As DAO.Database
Dim strSQL As String

Set db = DBEngine(0)(0)

strSQL = "UPDATE tblNext_and_Dates " _
& "SET tblNext_and_Dates.Next = #" & Format(Me.cboSchDate,
"mm\/dd\/yyyy") & "# " _
& "WHERE tblNext_and_Dates.[Training Name]= """ & Me![Training_Name]
& """"
Debug.Print strSQL
db.Execute strSQL
Set db = Nothing

End Sub

Jeanette Cunningham
 
Back
Top