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!

Using module open a table from another table.

Status
Not open for further replies.

Soumyaa

Programmer
Aug 14, 2003
2
US
Can anyone give a sample to write a code in a module to open one table from another?
 
Soumyaa

One way...

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "YourFormName"

'If linking this form to another using a specic record
stLinkCriteria = "[tblID]=" & Me![fldID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Richard
 
Hi,
Thanks for the reply. Actually, I am new to using modules in Access. Right now, I am facing problem running the module to test this code. When I create a new module and run it, it will show only the functions/procedures of one of the previously defined modules.
Also, when I am testing this code by putting it in a new module, it does not run. When I create a function and add this code into it and then run it, it says "me" not defined. When I check the help, it says me is defined only in the class modules. I don't know how to create class modules from access 2000. Actually I have always used Access as a database only.
Can you help me out here.
Once again thanks for the nice help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top