97 to 2000

wizcow

Registered User.
Local time
Today, 00:55
Joined
Sep 22, 2001
Messages
236
Hi

I am trying to use a posting routine from Acces97, in Access2000. But, it doesn't work.
It seems to hang up on the 'Dim Database'.

Public Function LookUpDescriptionAndPrice(tForm As Form, tItemNo As String)
DimtDB As Database, tTB As Table
Set tDB = CurrentDb()
Set tTB = tDB.OpenTable("Parts")
tTB.Index = "ItemNo"
tTB.Seek "=", tItemNo
tForm.Price = tTB.Cost
tForm.Description = tTB.Description
tTB.close
End Function

This is supost to post my Description and Cost fields.

Can anyone see the problem?
 
Dim DB As DAO.Database

Tools > References and add Microsoft DAO 3.6 Object Library.
 
Thank you, that part works now.

Now I am having the same problem with the 'Index' and 'Seek'.
I don't know how to get them into the object browser.
 

Users who are viewing this thread

Back
Top Bottom