Results 1 to 5 of 5
  1. #1
    Kipster1203 is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    May 2010
    Posts
    54

    Help please!!!!


    I have two columns, one is document names, and the other is due date

    In the form section, when the user enters the document name "Panel Outline & Layout" and a due date, Access needs to look to see whether another document, named "Panel Preliminary Outline", has a due date in the due date field or not. If it does not, then Access needs to set both dates equal. Here is what I have so far (Not much I know but hopefully someone can fill the gaps)

    Code:
    If Me.Name = "Panel Outline & Layout" Then
        If IsNull() Then
            
    
    Else
    
    End If
    So pretty much, when Panel Outline&Layout is updated, look at the cell for the due date of "Panel Preliminary Outline". If it's empty, set date of Panel Outline = Panel Preliminary Outline. Thank you!

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Is this a one-shot scenario or are there multiple instances where you'd need to check the due date of one item against another?

    If it's just this one document name, then you can do a straight-up comparison like you're trying. You'd need a lot more code though because you have to access information in the database, catch errors, etc.

    Assuming it's a straight-up comparison where you ONLY need to check the due date of "Panel Outline & Layout" against the due date of "Panel Preliminary Outline" then it's pretty simple.
    Code:
      ' Assume rstTable is a Recordset of your Table (with the proper Filter),
      ' DueDate is the name of the Date field in your Form,
      ' DocName is the name of the Document Name field in your Form,
      ' tblDueDate is the name of the Due Date field in your Table, and
      ' tblDocName is the name of the Document Name field in your Table
    
      If Me!DocName = "Panel Outline & Layout" Then
        If rstTable("tblDueDate") = "" Or IsNull(rstTable("tblDueDate")) Then
          With rstTable
            .Edit
            !tblDueDate = Me!DueDate
            .Update
          End With
        End If
      End If

  3. #3
    Kipster1203 is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    May 2010
    Posts
    54
    This doesn't work. It only needs to check once. The data is located in my main data table where the document column is called Document_Description and the date is called Rev_Date. I'm having trouble figuring out how to jump to a different line in the table to check the date field for data

  4. #4
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    If I'm understanding you correctly, it doesn't need to look at multiple records. Just grab the Document_Description and Rev_Date from the Form instead of the Table.

    If you have to grab the information from the Table instead of the Form, then you can either Filter the Recordset once for the first document and store that info into variables, then Filter the Recordset again for the second document. Then you can just compare the information in the Recordset to the variables.

    Or, you could open two Recordsets, each one Filtered to one of the documents. Then you can just compare them "directly."

  5. #5
    Kipster1203 is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    May 2010
    Posts
    54
    Quote Originally Posted by Rawb View Post
    If I'm understanding you correctly, it doesn't need to look at multiple records. Just grab the Document_Description and Rev_Date from the Form instead of the Table.

    If you have to grab the information from the Table instead of the Form, then you can either Filter the Recordset once for the first document and store that info into variables, then Filter the Recordset again for the second document. Then you can just compare the information in the Recordset to the variables.

    Or, you could open two Recordsets, each one Filtered to one of the documents. Then you can just compare them "directly."
    No I can do it directly on the form actually.

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

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