Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: Access 97 link to ID

    I have an Access 97 database that I use to log visits to customers. On the click of a "log visit" button, the database is suppose to take the autonumber(ProjectID) of the record I am on and pass that to the log table when opening the log form "Visit Logs". It is failing to do so and below is the commands I have used. Please advise if there is an easier way to do this that is consistent. Thanks!

    Private Sub Command68_Click()
    On Error GoTo Err_Command68_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Visit Logs"

    stLinkCriteria = "[ProjectID]=" & Me![ProjectID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit Sub

    MsgBox Err.Description
    Resume Exit_Command68_Click

    End Sub

  2. #2
    Join Date
    Jan 2003
    Not that smart posting an Access question in a DB2 forum, is it?

    Anyway , why not use a piece of SQL in your VBA to insert the ID into the log table an then open the form that uses the log-table as source?
    Ties Blom
    Senior Application Developer BI
    Getronics Healthcare
    SQL, SQL server

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts