Martin Reid
mwp.reid at qub.ac.uk
Sat Jun 17 06:05:31 CDT 2006
Thanks Stuard could not see the wood for the trees. You know I have just written up 38 pages of stuff on this and had done that in 3 examples. This one would not work and for the life of me I could not see why. Was driving me totally nuts. I had looked at the connection, the stored Proc, the command object, everything but your suggestion. Starting to remain me of the one where I reinstalled Office, then sql server and the code would still not work. Turns out I had spelt Microsoft wrong! Martin Martin WP Reid Training and Assessment Unit Riddle Hall Belfast tel: 02890 974477 ________________________________ From: accessd-bounces at databaseadvisors.com on behalf of Stuart McLachlan Sent: Sat 17/06/2006 11:02 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Stored Proc AGAIN On 18 Jun 2006 at 8:17, Martin Reid wrote: > Yip > But a move next fails. Something simple here I am sure > Since you Dim rstStudent in the on_open , it is local to that procedure and is destroyed at the completion of on_open. Put a Private rststudent As ADODB.Recordset at the head of the form module and don't declare it in the on_open. Then you should be able to do this sort of thing in another procedure: .... rstStudent.MoveNext If Not rstStudent.EOF then For Each fld In rststudent.Fields Me(fld.Name).Value = fld.Value Next End if ... > Martin > > -----Original Message----- > From: "Stuart McLachlan"<stuart at lexacorp.com.pg> > Sent: 6/16/06 11:56:00 PM > To: "Access Developers discussion and problem > solving"<accessd at databaseadvisors.com> Subject: Re: [AccessD] Stored Proc > AGAIN > > On 16 Jun 2006 at 20:09, Martin Reid wrote: > > > I have noticed some odd things in the way 2007 is working with SQL Server > > 2005 but the basic idea here is just that basic and no matter what I have > > tried I cant get it to assign the recordset. > > > > Any help appreciated. This is the last example I have to do so I jsut left > > it for the moment and moved on. > .. > > For Each fld In rststudent.Fields > > Me(fld.Name).Value = fld.Value > > Next > > End If > > What is the problem, doesn't this fill the controls on the form? > > -- > Stuart > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com/> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com/> -- Stuart -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com/>