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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically updating table from function call in form

Status
Not open for further replies.

BlakeMurphy

Technical User
Feb 20, 2001
1
US
Here is an overview of my problem:
A form is to be filled out. After the first two entries, a function is called to find matching entries in two different tables. From the matching records in the tables, values from other fields in the records need to be passed and concatenated into a unique code value. This value is then entered (automatically)as the third entry.
My problem is occurring on how to search the tables (using the function) and retrieve the necessary values from the fields.
I have no problem retrieving and using the two values entered in the form.
Can anyone help with this.
 
open 2 record sets
dim db a database, rst1 as recordset
dim rst2 as recordset, strvalue as string
set db = currentdb
set rst1 = db.openrecordset(table1name)
set rst2 = db.openrecordset(table2name)
rst1.findfirst(criteriastring)
rst2.findfirst(criteriastring)
strvalue = rst1!value & rst2!value
me!yourfield= strvalue
rst1.close
rst2.close



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top