Charlotte Foust
cfoust at infostatsystems.com
Thu Mar 6 15:04:44 CST 2008
I'm with Patricia, even in dotNet. I may be the only one in my shop who renames religiously, but I do it. There's little I hate as much as switching back and forth between design view and the code window trying to figure out which control I'm addressing when just a minor amount of time at the start lets me know exactly which control I need to address without all that effort. Plus circular references can pop up unexpectedly in places where they're harder to track down, so I buy insurance. Charlotte Foust -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Thursday, March 06, 2008 12:31 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Code Help Please Hi John, Yes, I can see that and I often do the same (but not religiously). I was more interested in why Patricia was saying the she recommended that ALL controls were ALWAYS renamed. I thought I was missing something essential but it really boils down to user's preferences on how they like to work and what problems they have experienced that they try to overcome/minimise. Also I have sometimes named the Field Name (Source) to identify the Type, eg datCreated, strCreatedBy but again not everytime. Depends on whether there is an R in the month ;-> Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, March 06, 2008 7:35 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Code Help Please Max, I also often rename the controls to not be the same as the control source, though I am certainly not religious about it. I like naming conventions and I like knowing that a control is a txt or a cbo or a lst etc. It just makes reading the code easier. I do so mostly when I am actually referencing the control in code, at that time I will rename the control. It also makes any search and replace operations easier to wade through since if you are looking for the object you can find it whereas if you are looking for the field you can find that. I must admit I do not spend time on it until I need to reference a control in code. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Thursday, March 06, 2008 2:04 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Code Help Please Thanks, I don't really understand that but then I have not had the experiences you clearly have had. I have personally not needed to do this but thanks for the explanation. Regards Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of O'Connor, Patricia (OTDA) Sent: Thursday, March 06, 2008 6:50 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Code Help Please I link to databases other than access. Years ago I had problems and by making the names slightly different 1) allowed better problem solving 2) circular references did not popup 3) if the database names changed it made updates a bit easier not all the code needed changing My opinion after 15+ years ************************************************** * Patricia O'Connor * Associate Computer Programmer Analyst * OTDA - BDMA * (W) mailto:Patricia.O'Connor at otda.state.ny.us * (w) mailto:aa1160 at nysemail.state.ny.us ************************************************** > -------------------------------------------------------- This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system. -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo > Sent: Thursday, March 06, 2008 10:26 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Code Help Please > > Hi Patricia, > > >>I would make sure the TXT box on the form has a different name than > >>the > CONTROL SOURCE > > Why would you want to do that? I know you can, but there is > absolutely no point that I can see. I actually make sure that all my > bound controls have the SAME NAME as the datasource so that I actually > KNOW what is being updated when I read my code. Am I missing > something here? > > Max > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of O'Connor, > Patricia (OTDA) > Sent: Thursday, March 06, 2008 2:56 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Code Help Please > > I would make sure the TXT box on the form has a different name than > the CONTROL SOURCE So if txtQBInvoice is the CONTROL SOURCE Then > change the txt box to txtQBInvoiceNbr > And change If Me.txtQBInvoice Is Null Then TO If > Me.txtQBInvoiceNBR > Is Null Then > > The only other thing I would think of trying is create the txt msg in > a string variable and see if it changes things > > Good luck > > > On Error GoTo Err_cmdPreviewPackList_Click > > > > Dim cancel As Boolean > > > > Dim lngRetval As Long > DIM txtMSG as string > > > > > > If Me.txtQBInvoiceNBR Is Null Then > txtMSG = "Please Select a Quick Books Invoice Number" & > vbCRLF > txtMSG = txtMSG & "Before Running Report." > > > lngRetval = MsgBox(txtMSG, vbOKOnly + vbExclamation + > vbDefaultButton2, "No QB Invoice Number Listed") > > > > > > > > > ************************************************** > * Patricia O'Connor > * Associate Computer Programmer Analyst > * OTDA - BDMA > * (W) mailto:Patricia.O'Connor at otda.state.ny.us > * (w) mailto:aa1160 at nysemail.state.ny.us > ************************************************** > > > > > -------------------------------------------------------- > This e-mail, including any attachments, may be confidential, > privileged or otherwise legally protected. It is intended only for the > addressee. If you received this e-mail in error or from someone who > was not authorized to send it to you, do not disseminate, copy or > otherwise use this e-mail or its attachments. Please notify the > sender immediately by reply e-mail and delete the e-mail from your > system. > > > -----Original Message----- > > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Joe Hecht > > Sent: Wednesday, March 05, 2008 10:26 PM > > To: 'Access Developers discussion and problem solving' > > Subject: [AccessD] Code Help Please > > > > The following code is supposed to make sure there is an > invoice number > > in the text box before previewing report. > > > > > > > > When I run it I get an application error msg box saying object > > required. > > > > > > > > What have I forgotten now, > > > > > > > > On Error GoTo Err_cmdPreviewPackList_Click > > > > Dim cancel As Boolean > > > > Dim lngRetval As Long > > > > > > > > > > > > > > > > If Me.txtQBInvoice Is Null Then > > > > lngRetval = MsgBox( _ > > > > "Please Select a Quick Books Invoice Number" & vbCrLf > & "Before > > Running Report.", _ > > > > vbOKOnly + vbExclamation + vbDefaultButton2, _ > > > > "No QB Invoice Number Listed") > > > > > > > > > > > > > > > > Select Case lngRetval > > > > Case vbOK > > > > cancel = True > > > > > > > > > > > > End Select > > > > End If > > > > > > > > TIA > > > > > > > > Joe Hecht > > > > Joe at anamericanjoe.us > > > > > > > > -- > > 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 -- 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