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!

Problems With 'Refresh Form' Module Code??? 1

Status
Not open for further replies.

Shokoya

IS-IT--Management
Aug 4, 2003
81
GB
Hi Guys,

Tried to Refresh a Form using the following module code;

Forms![Enquirer].Form![Quotation].Form![Work_Quotes].Refresh

This generated the following error message; Object does not support this property or method.

Changed the code to include brackets, resulting in the following;

Forms(Forms![Enquirer].Form![Quotation].Form![Work_Quotes]).Refresh

But this generates the error message Type Mismatch

Any assistance on the above problem will be greatly appreciated!!

[Cheers]
 
Forms![Enquirer].Form![Quotation].Form![Work_Quotes].Refresh

If those are forms and not subforms, you must Refresh them one at a time. Brackets should only be required if there are embedded spaces or using a reserved word for a form name.



HTH,
Bob [morning]
 
If embedded subform, try something like this:
Forms!Enquirer!Quotation.Form!Work_Quotes.Refresh

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Thanks Bob,

Quotation is a subform on Enquirer....and Work Quotes is a subform on Quotation.

So not quite sure how to apply the above rules you surgested. Pls instruct and have patience with this novice programmer!

[cheers]
 
Sorry for the typo.
If embedded subform, try something like this:
Forms!Enquirer.Form!Quotation.Form!Work_Quotes.Refresh

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
There are some things to consider here
1 - you need to use/find the subform control names, which might differ from the subform name as viewed in the database window
2 - if you're trying to do this from within one of the forms, you can shorten it a bit thru using the Me keyword.

Here's a Microsoft link on How to Refer to a Control on a Subform or Subreport explaining a bit of it.

Let's say for convenience that you form names equals the form control names, then

[tt]Forms![Enquirer].Form![Quotation].Form![Work_Quotes].Form.Refresh[/tt]

or, if it's called from the main form

[tt]Me![Quotation].Form![Work_Quotes].Form.Refresh[/tt]

or if it's called from the first subform

[tt]Me![Work_Quotes].Form.Refresh[/tt]
...

should normally work. But I'm guessing you'd have to work on retrieving the subform control names.

(one way of obtaining the correct control names, is to invoke the expression builder from the criteria row of a query (right click | build), then double click thru loaded forms, main form, first sub, second sub, and a control within the second sub - this should provide a reference to "tweak" a little with, to provide the result)

Roy-Vidar
 
Hi PHV....

Tried your code but still getting an error message...pls instruct.

[cheers]
 
Thanx Roy....

Forms![Enquirer].Form![Quotation].Form![Work_Quotes].Form.Refresh provided the solution!!

[cheers] to all else who contributed to this thread!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top