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

Need Help with a Sub Form of a Sub Form - :)

Status
Not open for further replies.

Computethis

IS-IT--Management
Feb 5, 2001
28
0
0
US
I have a main form with a subform inside it - that works great... HOWEVER, I want to click on a command button and call up a sub/sub form....

I have a main orders database, with a one-many relationship to a sub-orders databse.

That suborders database also needs to have several databases connected to it.

The Main database (tblOrderLog) contains the main info on the order. The Sub Job database (tblSubJobs) contains the breakdonw of all the individual jobs for that main job. All that works great setting up a sub form within the orders.

I want to insert a comand button on the SubJobs form that opens the "Engineering Notes" form (tblEngNotes) for that specific subjob... When I create a command button via Access 97 it only opens the first Engineering notes with int he entire database and not the one that coorelates to the specific subjob number.

Hope you understand.. I have several sub/sub databases that need to attached that away.

HELP...
Mitch
 
I don't know if I understand 100%...Is your "SubSub" a true sub to the sub to the Main or is it a form you want to pop up when needed? If latter:
DoCmd.OpenForm "frmSUBSUB", , , "[YourCoRelatingNumber] = " & Me.YourCorelatingNumber . Please clarify your use of the word "database" versus tables within a database. Gord
ghubbell@total.net
 
Gord,

Sorry for the confusin:

I have one Database with three tables in it. Here is the structure:

tblOrderLog---->tblSubOrders------>tblEngNotes

I already created a Form that has this makeup:

|--------------------------------------|
| tblOrderLog Form (MainForm) |
|=====================|
| tblSubOrder (SubForm) |
|--------------------------------------|


Within that SubForm that is tied to the tblSubJobs I want a button that will "pop-up" another form that is tied to the tblEngNotes. That away a designer can enter in a multitude of notes about the SubJob....

Does that help ????

Thanks!!!!
 
If your command button is on the main its on click event would be:
DoCmd.OpenForm "frmSUBSUB",,,"[YourCoRelatingNumber] = [Forms]![MainFormsName]![SubFormsNameAsSeenByTheMainForm].[Form]![YourCorelatingNumbersFieldName]"

If the command button is on the subform then as previous.
Make sure to set your "SubSub's" corelating number field's default value to = [Forms]![MainFormsName]![SubFormsNameAsSeenByTheMainForm].[Form]![YourCorelatingNumbersFieldName] if you're using this for data entry. Gord
ghubbell@total.net


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top