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

open an Update QUERY

Status
Not open for further replies.

cppiston

Programmer
Feb 27, 2002
23
0
0
US
Here is a copy of the code in my form:

Private Sub OpenFormOP2()
On Error GoTo Err_OP1Start_Click

Dim stOP2Start As String
DoCmd.OpenQuery stOP2Start, acViewNormal, acEdit

Exit_OpenFormOP2:
Exit Sub

Err_OP2Start_Click:
MsgBox Err.Description
Resume Exit_OpenFormOP2

End Sub

HERE IS A COPY OF THE CODE IN MY QUERY:

UPDATE tblJobTracking SET tblJobTracking.OP2Start = Now(), tblJobTracking.OP2 = "w"
WHERE (((tblJobTracking.JobID)=[Job ID]));

ALL I want is to have the form automatically run and open the query when I run the form... how can this work??

Thanks
 
Are you saying you want the query to perform the update, and then display the results?

Update queries are action queries, so Normal mode just performs the update. Try using acViewPreview instead of or in addition to acViewNormal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top