Strange Problem with Form/Subform linking

Sandpiper

Registered User.
Local time
Today, 05:51
Joined
Feb 21, 2006
Messages
55
Hi All

I've got a really strange problem with a form that I can't work out, and wondered if anyone could help me.

I have a form with a subform. When a field in the subform is clicked, the mainform updates to show the details.

The code i'm using is

Me.Parent.RecordSource = "SELECT Jotbl_PriceRequest.* " & _
"FROM Jotbl_PriceRequest WHERE Jotbl_PriceRequest.PRID =" & Me.PRID

What I don't understand is that when you go into the form, this code isn't working, however if I go into design view and then straight back to form view, it works perfectly. Can anyone tell me what is happening to enable this code.
:(
I'd really appreciate any advice.

Thanks
 
What is the location of the control, that is supposed to fire this code and what event is it behind?

This link about referencing sub forms may help.
 
this really isnt a form/subform

how can the main form be dependent on the subform ?

the subform should show items dependent on the main form - any information shown in the subform should be independent of the main form
 
Last edited:
Thanks for the responses.

The control that holds this code is in the subform and it's behind the On Click event.

I agree that it's not a normal form/subfom relationship in this sense.

The main form is where a user would enter the information for a price request (i.e, Material, Customer and Date and Notes,) All active price requests are then held in a subform (datasheet view) (sorry if this is the wrong terminology, I don't know what else to call it) on the same page. This is so the user can check that the request hasn't already been made by someone else.

When the person who completes the request goes into this screen, they need to be able to view the inforamtion in a Mainform so that it is editable and so they can see large spaces for notes fields. This was the thought behind click on a record on the subform to then open the full details in the main form.

I hope that makes sense.

Thanks
 
If I've understood you correctly; What you want, is a form where the user can select a supplier, and then view all the outstanding price requests. Then from those outstanding price request you want the user to be able to select one, open it and edit it?

If this is correct; What I would do is to have a Double click event to open the required record in another form to allow the user to edit it and add whatever notes are required. The on close event of this form would the requery your sub form to update the record.
 

Users who are viewing this thread

Back
Top Bottom