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

Can't find form..?

Status
Not open for further replies.

Kujen

Technical User
Oct 13, 2007
57
SE
Hi all,

I have a mainform with a listbox.
The listbox is supposed to query the subform from a 'after_update' event:
=============================
Dim sfrm As Form
Set sfrm = Forms![FrmSubForm].Form
With sfrm
.RecordSource = "select * from Qry1 where [SalesPerson]='" & Listbox1 & "' ORDER BY SumIntakt_LS DESC"
End With
=============================
The problem is that I get the error: 'Can't find FrmSubForm..'

What can be wrong?

Kent J.
 
How are ya Kujen . . .

Open the mainform in [blue]design view[/blue], then:
[ol][li]Call up the properties window (if its not displayed already) with the ToolBar button
Properties.BMP
.[/li]
[li]Select the [blue]Other Tab[/blue].[/li]
[li]Select the border of the subform (selects the subform).[/li]
[li]Have a look at the [blue]Name[/blue] property. This is the name you should be using![/li][/ol]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
TheAceMan1,

Thanks.
Now I dont't get the errormessage but I just get one single records with:
Set sfrm = Forms![FrmMainForm]![FrmSubForm]!Form

I have checked my FrmSubForm and it's set to 'continously'

Kent J.

 
what happens if you replace this:
Set sfrm = Forms![FrmSubForm].Form
with this ?
Set sfrm = Me![FrmSubForm].Form

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
. . . or [blue]Set sfrm = [FrmSubForm].Form[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top