assign a record

shaomwang

Registered User.
Local time
Today, 18:30
Joined
Apr 22, 2000
Messages
14
I have a table including 3 fields. Company, Product_ID and Order_Date. How can I use VB code to take any one record in Order_Date field and assign to a variable?

[This message has been edited by shaomwang (edited 11-14-2000).]
 
your vb code should look like this:

Dim myvariable as date (actually declare variable in appropriate form ie String Number and so on)
Dim myrs as recordset
Dim mydb as database

set mydb = currentdb
set myrs = mydb.openrecordst("name of table")
myrs.movefirst
myvariable = [myrs]![Order_Date]

This code makes your table a recordset you can only edit tables using VB if they are a recordset Good luck let me know if this helps my email address is jkc3computerhack@yahoo.com
 

Users who are viewing this thread

Back
Top Bottom