John W. Colby
jwcolby at colbyconsulting.com
Fri Apr 2 16:43:21 CST 2004
uhh... or Gilda Radner on Saturday Night Live? ;-) John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John W. Colby Sent: Friday, April 02, 2004 4:59 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Add new record + fill fields with last entered data ? As Lilly Tomlin used to say on Laugh-In Oh. Never mind! John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of S D Sent: Friday, April 02, 2004 8:55 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Add new record + fill fields with last entered data ? John (and others) I didn't mean to offend anybody but I think i'm in a different line of work. Where doing maintenance on EXISTING apps. We don't build them ourselves (we also do that but not for this customer) Frameworks are GREAT! I'm playing around with you're examples a lot and I love it. But it's (almost) impossible to implement these in existing apps without rebuilding them from scratch. Extra problem here is that everything is on a very tight budget. Anyways, thnx for the reply. Regards, Sander "John W. Colby" <jwcolby at colbyconsulting.com> wrote: Sander, >Some are more complex then others and in some cases (way) too heavy, how's that sledgehammer John ;-) but they all help! While I can appreciate personal opinion I have to ask how putting reusable code into a framework is (way) too heavy? In the beginning was assembler, and all was right. But there was no structure and it took forever to write code, so higher level languages were designed with functions and dimensioned variables. Of course there were those who scoffed at the overhead, and how slow it ran, but in general it was accepted as a good thing and was taught in schools and used by many programmers. But there were still many problems that remained and concepts such as objects, and classes and inheritance were designed. Of course there were those who scoffed at the overhead, and how slow it ran, but in general it was accepted as a good thing, and was taught in school and used by many programmers. Re-use, encapsulation, and all that stuff is (now) widely accepted practice. Whether or not you personally like these practices is only relevant to you (and the cost to your client of course). Have you ever heard of Steve Gibson of Spin Right fame? He does all his programming in assembler! Hmm... ok. For his purposes that is apparently just right, but it doesn't mean I want to do that. A framework is nothing more or less that reusability / encapsulation taken to the next level. It isn't like I invented the concept - ever heard of .NET? Can you say FRAMEWORK?. When you "attack" using a framework you are simply demonstrating a preference for a way of doing things that may be better for your purposes but definitely is NOT better for my purposes, nor I suspect, for many other people. >how's that sledgehammer John Just fine thanks. John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of S D Sent: Friday, April 02, 2004 12:54 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Add new record + fill fields with last entered data ? Hihi here we go again. Everybody uses a different approach and they all work! Some are more complex then others and in some cases (way) too heavy, how's that sledgehammer John ;-) but they all help! thnx a lot. Now all i have to do is do a LOT of documenting and then it's of to find myself a weddingsuit! regards, sander "Brock, Christian T, HRC-Alexandria" wrote: The copy record and paste append commands will get every form field and subform. Do not see how what you say to do provides any benefit over using the three DoCmd.RunCommand statements. Christian Brock -----Original Message----- From: William Hindman [mailto:wdhindman at bellsouth.net] Sent: Thursday, 01 April 2004 10:49 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Add new record + fill fields with last entered data? ...that "wizard" simply bites ...I'd create a "duplicate" button that saves the pk of the current record to a variable or tag and then a query using the saved pk to append a "new" record that is a duplicate of the saved one except for the pk ...that would get you a dupe of every form field including any subform. William Hindman ipsedixitism: something is true because I myself have said it is true ...the philosophy of Noam Chomsky :) ----- Original Message ----- From: "Brock, Christian T, HRC-Alexandria" To: "'Access Developers discussion and problem solving'" Sent: Thursday, April 01, 2004 10:22 AM Subject: RE: [AccessD] Add new record + fill fields with last entered data? > Why go to the trouble? From the statement of intent, What the user really > wants is a duplicate current record button, instead of a new record button. > The Access XP command button wizard will allow you to create a button that > will duplicate the current record. > > It creates the following lines of code > DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70 > DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70 > DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append > > Obviously MS did not update the wizard to use readable code. The following > will work as well. > DoCmd.RunCommand acCmdSelectRecord > DoCmd.RunCommand acCmdCopy > DoCmd.RunCommand acCmdPasteAppend > > > Christian Brock > > > > > -----Original Message----- > From: Gustav Brock [mailto:gustav at cactus.dk] > Sent: Thursday, 01 April 2004 09:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Add new record + fill fields with last entered data? > > > Hi Tina > > > I begin to understand. At the OnCurrent Event for the Form, the Event > > Procedure will set the DefaultValue of each TextBox to the values > > determined to already be stored in the record just saved. Is that > > correct? > > Yes and no. No saving needs to take place: > > At the OnCurrent Event for the Form, the Event Procedure will set the > DefaultValue of each TextBox (or ComboBox etc.) to the values for the > current record of those controls. > > > Does this require explicitly listing each TextBox of the form? > > Yes. > > /gustav > > > >>>How does one set the DefautlValue at OnCurrent? I don't know how to do > >>>that. > >> > >>That's not difficult - something like this: > >> > >> Dim txt As TextBox > >> Set txt = Me!txtYourTextBox > >> > >> txt.DefaultValue = txt.Value > >> > >> Set txt = Nothing > >> > >>However, DefaultValue should be a string which means that if your > >>textbox contains decimals or a date/time value you must be careful and > >>convert to a string in US format: > >> > >> txt.DefaultValue = LTrim(Str(txt.Value)) > >> > >>or > >> > >> txt.DefaultValue = _ > >> Format(txt.Value, "\#mm\/dd\/yyyy hh\:nn\:ss AM/PM\#") > >> > >>/gustav > >> > >>>>Tough day? No coffee? > >>>> > >>>>Set the DefaultValue at OnCurrent. > >>>> > >>>>As for Stuart's note on the KeyPreview, it's not a user feature, but a > >>>>property of the form. > >>>> > >>>>/gustav > >>>> > >>>>>when a user clicks the 'Add new record' button (s)he wants the data of > the current record to be displayed in the new record. > >>>>>So if a user is on record 999 with field username filled with AAA and > then clicks on 'Add new record' then a new record (1000) must appear with > the field username filled with AAA. > > -- > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com --------------------------------- Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway - Enter today -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com --------------------------------- Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway - Enter today -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com