[AccessD] Open diff forms based on number

Arthur Fuller artful at rogers.com
Sat Mar 22 10:12:00 CST 2003


I knew I shouldn't have written it in Outlook! It's FormName not
DocumentName. :-)
 

"Those who would sacrifice liberty for security deserve neither."
-- Benjamin Franklin 

-----Original Message-----
From: accessd-admin at databaseadvisors.com
[mailto:accessd-admin at databaseadvisors.com] On Behalf Of Hollis,Virginia
Sent: March 22, 2003 10:09 AM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] Open diff forms based on number


DocumentName:=
Named argument not found.
 
The one letter will work since only certain types begin with different
prefixes, Z, C, F, etc.
 
Z99999
CCP-9999-99
FPT-Z9999-001

-----Original Message-----
From: Arthur Fuller [mailto:artful at rogers.com]
Sent: Saturday, March 22, 2003 8:52 AM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Open diff forms based on number


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/5eccce8d/attachment-0001.html>


More information about the AccessD mailing list