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

It gives me "The form name you ente

Status
Not open for further replies.

jaanisf

Technical User
Apr 30, 2003
50
LV
It gives me "The form name you entered doesn't follow MS object-naming rules" error. What is wrong with this?

Me.subform2.SourceObject = &quot;SELECT TOP 10 [tien].[datums] AS Datums, [tien].[nosaukums] AS Nosaukums, [tien].[summa] AS Summa, [tien].[pieziimes] AS Piezîmes FROM tien WHERE ([tien].[ienaakumuid]<= txtid) ORDER BY [tien].[ienaakumuid] DESC;&quot;

 
Hi!

A few of questions:

Where is this code located?
What is in the entire procedure?
What are you trying to accomplish with this code?



Jeff Bridgham
bridgham@purdue.edu
 
[Mainform1] = Main form
[Subform1] = Subform in a main form
[Subform2] = Subform in a Subform1

[Mainform1] is just for better looking. Its subform [Subform1] is for adding records to table [tien]. And [Subform2] is a subform in a tabular view located in a [Subform1]. It shows 10 latest records, so that I can easily see, what's been recently entered.

[txtid] is a TextBox with a default value Now(), located on a [Subform1]. Subforms [Subform1] and [Subform2] are not linked. I want just to put this code behind OnOpen and OnCurrent procedures. But it gives me this error ;)

Btw, I tried to place that sql string stright in [subform2] record source, but then, on opening [Subform1] it asked for the value Me!Parent.txtid or Forms!Mainform1!Subform1.txstid whatever code I put there.. :/
 
Hi!

Okay, the code you need is:

Me!subform2.Form.RecordSource = &quot;SELECT TOP 10 [tien].[datums] AS Datums, [tien].[nosaukums] AS Nosaukums, [tien].[summa] AS Summa, [tien].[pieziimes] AS Piezîmes FROM tien WHERE ([tien].[ienaakumuid]<= txtid) ORDER BY [tien].[ienaakumuid] DESC;&quot;


But it seems like you could set up tables and/or queries to handle this automatically.

hth


Jeff Bridgham
bridgham@purdue.edu
 
I write it for Access 97, and it doesn't handel queries in subforms as far as I know, only reports and forms ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top