ACC95: Advanced Topics Questions and Answers (7.0)

ID: Q137349


The information in this article applies to:
  • Microsoft Access 7.0

Moderate: Requires basic macro, coding, and interoperability skills.

SUMMARY

This article contains questions and answers about advanced topics in Microsoft Access version 7.0.


MORE INFORMATION

  1. Q. How can I create an expression to extract a portion of a text field?

    A. To extract a portion of a text field, use expressions that contain the Left(), Right(), InStr(), and Mid() functions. These expressions are commonly used in the Update To line of an update query to place a portion of a larger field into a new field.

    For example, to extract the name "John" from a field containing the name "John Doe," use the following expression:
    
              Left([FullName],InStr(1,[FullName]," ")-1) 

    and to extract the name "Doe" from the name "John Doe," use the following expression:
    
              Right(Trim([FullName]),Len(Trim([FullName]))-
              InStr(1,[FullName]," ")) 

    For additional information about parsing character strings, see Q115915.


  2. Q. How can I create an expression to return a value from a table or query using the DLookup() function?

    A. With the DLookup() function, you can return a value from a specified set of records, such as a table or query. The syntax of the Dlookup() function is as follows:
    
              DLookup(<expression>, <domain> [, <criteria>] ) 

    The function has the following three arguments:

    • <Expression>: Identifies the field that contains the data in the domain that you want returned


    • <Domain>: Identifies the table or query that contains the data you want returned


    • <Criteria>: An optional string expression, similar to a WHERE clause in an SQL statement, that restricts the range of data used in the function


    The DLookup() function returns one value from a single field even if more than one record satisfies the criteria. If no record satisfies the criteria or if the domain contains no records, the DLookup() function returns a null.

    For additional information about using the DLookup() function, see Q136122.


  3. Q. How can I calculate date/time data to display specific dates or elapsed time?

    A. Microsoft Access stores the Date/Time data type as a double- precision, floating-point number (up to 15 decimal places). The integer portion of the double-precision number represents the date; the decimal portion represents the time. Because a date/time value is stored as a double-precision number, you may receive incorrect formatting results when you try to display specific dates or calculate elapsed time greater than 24 hours.

    For additional information about calculating date/time data, see Q88657.


  4. Q. How do I create synchronized combo boxes?

    A. With synchronized combo boxes, you can make a selection in combo box 1, which then filters combo box 2 to list only items related to the selection in combo box 1. For a detailed example of creating synchronized combo boxes, see Q98660.


  5. Q. Can I open multiple copies of the same form?

    A. Yes, in Microsoft Access for Windows 95, you can open multiple instances of the same form. Opening multiple instances of a form gives you the flexibility to work on more than one record at once. For example, in an Order Entry program, you can start taking an order, pause and take a second order, and then return to the first order without losing any data.

    For additional information about opening multiple instances of a form, see Q135369.


Additional query words:

Keywords : kbdta
Version : 7.0
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: October 19, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.