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

Read field, open form based on contents

Status
Not open for further replies.

MrsTFB

MIS
Oct 3, 2000
307
US
Help please:
I'm using the following code to open a query and based on the value in the field 'Status' display a particular form. THe value in status will change as the process is completed. I need to be able to read the value and if it's 2, I'll open a different file. There's something wrong here with the syntax, I think.
There's more code, but this is the part I'm having trouble with. Thanks in advance!

stDocName1 = "frmEditRecInsp1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
If [Query]![qryEditInspReportbyRptNum]![Status].Value = "1" Then
DoCmd.OpenForm stDocName1, acNormal, acEdit
End If
 
This query returns only one row ?
either play with a DAO.Recordset object or with the DLookUp function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top