Hollis,Virginia
HollisVJ at pgdp.usec.com
Thu Jan 30 07:56:00 CST 2003
I have been off the list for awhile - you sure have gotten fancy with subscribing the last few months!! *********** Problem: I have a form that users select their name from a combobox, it opens a main form that allows them to edit only active requests. I am having problems with the main form opening even if they do not have any active requests (they are closed). If they do not have any active requests, the message box "No Open EFRs" should display, but it doesn't, the frmSystemFailure opens & I receive an error, can't go to specified record (on the main form OnOpen, I have it set focus to a certain field). How can I prevent the frmSystemFailure from opening & display the message? UserID is the name of the combobox. 'Status is Pending, In Progress, or In Review, and User ID = Engineer ID stDocName = "frmSystemFailure" stLinkCriteria = "[EngineerID]=" & Me![UserID] & " AND [StatusID] = 1" & _ "Or [EngineerID]=" & Me![UserID] & " AND [StatusID] = 2" & _ "Or [EngineerID]=" & Me![UserID] & " AND [StatusID] = 4" ' Check whether the user has any EFRs open. If they do, open the ' form with a filter. On Error Resume Next If DCount("EngineerID", "tblEngineer", stLinkCriteria) Then DoCmd.OpenForm stDocName, , , stLinkCriteria Else 'Display Message "No open EFRs" MsgBox "No open EFRs for " & Forms![frmUpdateEFRs]![UserID].Column(1) End If ' Close the dialog box. DoCmd.Close acForm, "frmUpdateEFRs" -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030130/61a4ea88/attachment-0001.html>