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

MULTIPLE SUBFORMS FROM MULTIPLE TABLES

Status
Not open for further replies.

mdavis1

Programmer
Aug 14, 2000
30
US
I have a main database that contains a main product. In this database, the product has 12 categories. I want to be able to pull the # up in the main database, and have a button that will pull up the category form. I can do that for 1 category, but i'm having trouble telling the button which form to pull up. There is a different form for each category. I was thinking maybe putting an option button on the main form, telling it which category it was in????
I'm lost here. If someone could point me in the right direction, i would be forever greatful. Thanks in advance!!!:~
 
If you have a different form for each Category, consider storing the form name as a field with the Category table. So, if you pull up the number from the database, and you give the user the ability to launch a category form, the underlying VB routine can pick up the form name from your datasource field. Then your form launching button could do something like this

Private Sub cmdOpenCategory_Click()
On Error GoTo Err_cmdOpenCategory_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = Me.CategoryFormName "assuming this is a field avalable from your datasource
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenCategory_Click:
Exit Sub

Err_cmdOpenCategory_Click:
MsgBox Err.Description
Resume Exit_cmdOpenCategory_Click

End Sub petersdaniel@hotmail.com
"If A equals success, then the formula is: A=X+Y+Z. X is work. Y is play. Z is keep your mouth shut." --Albert Einstein

 
Geeez..and you made it so easy [thumbsup]
Thanks a million
[thumbsup2]
 
ok...one more question :)
After i get that info, i want to print it in a report.
so how do i make the report pick that form also?
i made a query and combined the two tables, but i can't seem to get it to bring the category form? Thanks in advance :)
 
I figured it out. Just takes a little patience. Thanks everyone for contributing to this site. It has helped me tremendously . THanks again and ya'll have a great day :p
 
OK. I JUST THOUGHT I HAD IT. HELP. I CAN'T GET IT TO PULL UP THE RIGHT CATEGORY FORM IN THE REPORT. HELP HELP HELP.
MANY MANY THANKS IN ADVANCE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top