If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Access 97 link to ID

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-21-03, 11:31
i78040 i78040 is offline
Registered User
 
Join Date: Oct 2003
Posts: 4
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_Command68_Click:
Exit Sub

Err_Command68_Click:
MsgBox Err.Description
Resume Exit_Command68_Click

End Sub
Reply With Quote
  #2 (permalink)  
Old 11-24-03, 07:59
blom0344 blom0344 is offline
Registered User
 
Join Date: Jan 2003
Location: Zutphen,Netherlands
Posts: 256
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
DB2,ORACLE,Powercenter,BusObj,Access,
SQL, SQL server
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On