[AccessD] Open diff forms based on number

Stuart McLachlan stuart at lexacorp.com.pg
Sat Mar 22 08:27:00 CST 2003


et > 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

Set up a key table

Z ; "frmServiceOrder"
CPP ; "frmReview"
etc

Assuming you are using a continuous form and the document number is in 
txtDocument:

Private Sub txtDocument_OnClick()

Docmd.Openform DLookup("FormName","tblDocumentTypes",DocType like '" & 
txtDocument & "*'"



-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System Support.






More information about the AccessD mailing list