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

Subform links and updates 1

Status
Not open for further replies.

maxcess

IS-IT--Management
May 23, 2004
6
US
I have an Orders form, without any underlying related tables.

Located in the upper half of this form, I have a sfrmOrders in datasheet view with a ssfrmOrderDetails as a subform embedded in it. On the lower half of the form, I have a sfrmOrderProcessing in single form view.

The goal is for the user to start with a list of open sfrmOrders, expand the plus sign next to each order to see all the items that need to be processed in that order shown in the sfrmOrderDetails datasheet, then click on a line in the sfrmOrderDetails and populate the sfrmOrderProcessing area below with for editing.

The link between the sfrmOrders and sfrmOrderDetails works fine, but for some reason I can't get the sfrmOrderProcessing to update when clicking on the sfrmOrderDetails.

I tried using a link at the top of the Orders form called [txtLink] pointing to the control =[sfrmOrders].[Form]![ssfrmOrderDetails].[Form]![OrderDetailID]

It works, within only on one record of the sfrmOrders datasheet, and does not update when going between sfrmOrders records.

The Orders form has no underlying tables because it needs to combines the datasheet views with a single form view. The top level form is sfrmOrders. Is there another way to do it?

The sfrmOrders (tblOrders) has the list of main orders. each of which can contain many different parts in ssfrmOrderDetails (tblOrderDetails). The sfrmOrderProcessing has the information that an employee needs to know to laser mark each part (tblOrderProcessing), updating the status of the order as each part is marked in the overall order. It is a single form, because it contains print buttons and photos that cannot be displayed in datasheet view. The top two datasheet forms are mostly for navigation, being able to see the order and order details in a selectable tree view.

What am I missing?
 
I have never tried to do what you are saying that way, but I would think it can be done. I am having a hard time seeing how you have this set up. If you can post a version I will take a look. If you are linking your single form to the txtbox then you may need to use the OnCurrent event of the continous view to set the value of the txtlink.

You may consider two continous subforms, and one single form view.

Subform 1 is orders, subform 2 is order details. Click on an order in sub1 and show all the details for that order. Click on a detail and show that record in subform 3 processing. Here is an example:
except the 3rd subform is continous not single.

If you really need a more hierarchical you may consider a listview or treeview control as your navigation.

I still think you should be able to do it the way it is currently set up, but you will need to explain better the child / master links for each of your sub forms.
 
Here is the database. I thought I had the right OnCurrent expressions, but could be wrong. My first version of the form used two continuous subforms as you suggested. It worked fine mechanically, but is not as easy to use. I have not used a treecontrol, so if you have a suggestion after viewing the attached, I am open to the idea.

I have never used box.net to upload a link, so bear with me here...
 
 http://www.box.net/files#0:f:24635604
I can not seem to log in without an account.
 
I would use the afterupdate event of the subform ssfrmOrderDetails to requery the second subform sfrmOrderProcessing. Also check you child/parent links to make sure they are working ok.

Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
This works

On the main form put a textbox "txtBxLink"

on the order details subform on current event.

Private Sub Form_Current()
Me.Parent.Parent.txtBxLink = Me.OrderDetailID
End Sub

Link the processing subform to the textbox

Master field: [txtBxLink]

You can get rid of all other code in the orders subform that does requerying. No need.
 
That nailed it! Thank you for helping.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top