Results 1 to 6 of 6
  1. #1
    radicrains is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    29

    Unhappy Is my programming wrong? :(

    Hey guys,

    I need help. I need to extract out data.. Please refer to "Picture 1" for the table...

    From this table, I need Access to be able to compare the 2 fields, and extract out the overdue drawings.. From what my mentor's condition, he said that overdue drawings are drawings that do NOT have "LatestRevDate", from the picture, you can see that it's Drawing 2729-01.01 and 3076-41.01

    Can anybody help me out so that i could get the end product(refer to picture2)

    For far, me and my colleague have use VBA to create the functions, but it outcome is not what we wanted, please help us out on this.. thanks.

    -----------------------------------------------------------------------
    [Note: FieldArray(1) is "latestRevDate" and FieldArray(0) is "DateToOwner"]

    Function Overdue(ParamArray FieldArray() As Variant)

    ' Declare a variant


    Dim N As Variant

    ' setting a variant
    N = Null

    ' Condition
    If FieldArray(1) = Null And FieldArray(0) <> Null Then
    N = FieldArray(0)
    End If

    End Function

    -----------------------------------------------------------------------

    Thanks in adv!

  2. #2
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I believe that you should be able to do what you want with a query such as the following (you will have to substitute your own table name):

    SELECT YourTableName.DrawingNo, YourTableName.Title, YourTableName.DateToOwner, YourTableName.LastRevDate, IIF(isNull(LastRevDate), IIF(isNull(DateToOwner),null,DateToOwner),null) as OverdueDrawings
    FROM YourTableName;

  3. #3
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by jzwp11 View Post
    IIF(isNull(LastRevDate), IIF(isNull(DateToOwner),null,DateToOwner),null) as OverdueDrawings
    FROM YourTableName;
    I don't think 'isnull()' works in queries, but I may be wrong. it is reserved for VBA. It might need to be:
    Code:
    value is null

  4. #4
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    ajetrumpet (Adam),

    IsNull() is a valid Access function as well as being a VBA function.

  5. #5
    radicrains is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    29
    Got it! thanks!

  6. #6
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You are welcome. Good luck with your project.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. 2 programming issues
    By gripper in forum Programming
    Replies: 3
    Last Post: 10-06-2010, 11:10 AM
  2. programming a continuous form?
    By Ferret in forum Programming
    Replies: 3
    Last Post: 05-30-2010, 04:51 PM
  3. Help Please - Programming Labels
    By graviz in forum Programming
    Replies: 4
    Last Post: 03-02-2010, 10:37 PM
  4. VB Programming
    By mstefansen in forum Programming
    Replies: 4
    Last Post: 08-31-2009, 07:15 AM
  5. New to Access programming
    By pushpm in forum Programming
    Replies: 1
    Last Post: 02-20-2009, 03:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums