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!

Setvalue from sub form to Pop up form

Status
Not open for further replies.

Stoffman

Programmer
Apr 6, 2005
42
GB
I am opening up a Pop up form from a subform and showing records with linked values. This works fine, however when I choose an option on the Pop up form I want to link this record back to the subform.

I have tried Setvalue where the Cust_id value in the popup form = The cust_id in the subform, but the error messge 'Microsoft Access can't find the form FRM: Customer Sub form referred to in a macro expression or visual basic code'-the form you referenced may be closed or does not exist.

The Subform is not closed and does exist, does anyone know how this can be done.

Cheers Stoffman
 
You may try something like this to reference the subform's control:
Forms![mainform name]![subform control name].Form!cust_id

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
It nows moans about 'The object doesn't contain the automation Object'Cust_No'

-You tried to run a visual Basic procedure to set a property or method for an object. However, the component doesn't make the property or method available for automation operations.

The Subform is not locked and is enabled and so is the field I am trying referenece. This works when theis form is not a sub form. So I can only asssume it has something to do with the fact that is has to be a subform. Any more Ideas

Can I use global Variables and if so how?

Cheers Stoffman
 
How are ya Stoffman . . . . .

Stoffman said:
[blue]however when I choose an option on the Pop up form [purple]I want to link this record back to the subform.[/purple][/blue]
I get you drift, but can take one of several paths in response.

[purple]Be a little more specific about this . . . [/purple]

Calvin.gif
See Ya! . . . . . .
 
Cheers guys. Got it sorted in the end changed the set value from
.[Cust_Id] to ![Cust_id]. How annoying??
 
. is for property/method, ! is for member of the collection.
If you reread my suggestion you'll see you had the solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top