Arthur Fuller
artful at rogers.com
Sat Mar 22 08:53:01 CST 2003
Everything can be done, Virginia. Since the document-type prefixes seem to be different lengths, you'll have to examine each one separately. It would be more convenient if they were all the same length (i.e. CPP is equivalent to C since no other document type starts with C). Something like this: If Left(txtDocumentID1) = "Z" Then strFormName = "frmServiceOrders" strQuery = "ServiceID = " & txtDocumentID ElseIf Left(txtDocument, 3) = "CPP" Then strFormName = "frmReviews" strQuery = "ReviewID = " & txtDocumentID ElseIf ... etc. End If DoCmd.OpenForm DocumentName := strFormName, WhereCondition := strQuery HTH, Arthur -----Original Message----- From: accessd-admin at databaseadvisors.com [mailto:accessd-admin at databaseadvisors.com] On Behalf Of Hollis,Virginia Sent: March 22, 2003 9:13 AM To: 'accessd at databaseadvisors.com' Subject: [AccessD] Open diff forms based on number I have a search form that I would like to show the actual record opened in a separate form when the number is clicked. The only problem, the search results list different types of documents so clicking the number would require a different form to be opened based on the number selected. The same type of documents begin with the same numbering scheme. For example, service orders all being with Z, Reviews begin with CPP, etc. Each type of document is different and has it's own screen because they contain different data (so I can't use one screen for all results when the number is clicked). The only thing I can think to base the results on is the numbering scheme? If the number is like Z open service orders, if the number is Like CPP, open the review form. Really not sure how I can do this or if it can be done? Virginia -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030322/43ab9b22/attachment-0001.html>