Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to lookup but not keep

Status
Not open for further replies.

jedrtd

Programmer
Jul 22, 2001
23
US
I have a database to keep track of domistic postage, I need to just get the foreign postage from a table of rates for the weight and print out a sheet to go in the jacket. I don't need to keep this info we don't track it. I just want to give the billing people the rate to charge for the foreign ones.
 
create a function

Public Function PostageRates(somevalue)
' open the Postage table and find data
Dim db As DAO.database, rst As DAO.Recordset
Dim SQL1 As String
Set db = CurrentDb
SQL1 = "Select * From [YourPostageTable] Where yourfield = " & somevalue
rst.MoveFirst
' not this does not TRAP for no value errors
PostageRates = rst!yourfield
rst.Close
db.Close
End Function
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
I keep getting a user-defined type not define and it is hi-ligthing the dim db as database, rst as recordset
 
Another possible solution to consider is Dlookup() function.

Dlookup("[yourfield]","postagetble","weight = " & me.field)

check it out under access help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top