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

How to access a

Status
Not open for further replies.

NickBlake

Programmer
Nov 28, 2003
10
GB
Hi

What I need to know is if there is a way I can access the information gathered by a data control in 1 form on a different form.

The code I am using below lets me access the database using data2 from form1 so that I can find a particular record and display all the information in the fields on form1. What I want to do though is to execute this code using a button on form2 but display the information on form1. Is there any way I can declare the data control data2 as global.

FindRefNo = InputBox("Please enter the reference number you wish to find", "Find Reference Number")
Set mytable = Data2.Recordset

mytable.Index = "PrimaryKey"
mytable.Seek "=", FindRefNo
 
You could put the code in a module and explicitly name the forms with the contols on, ie. by using:
form1.mycontrol1
form2.mycontrol2
This way you could pass data local to the module between the 2 forms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top