OnCurrent of Form - Make not visible on condition - 134062

I currently have the following code under the onCurrent of my form:

Private Sub Form_Current()
Dim strSQL As String
Dim db As DAO.Database

    If Me.ID < 0 Then
    Set db = DBEngine(0)(0)
    strSQL = "INSERT INTO LastVisitedRecord ( lvCompanyID ) " _
                & " VALUES ( " & Me.ID & " ) "
    db.Execute strSQL
    Set db = Nothing
    End If
End Sub

However, I'd like to add something to it, but have not had success.
I'd like the form to evaluate if the NOTES field is empty (which is
there but not visible) and if so, make other controls and labels not
visible. These controls are:

OldNotesLabel
OldNotesBox
OldNotesSubForm

the old notes subform (which contains the NOTES field) is visible =
false until the OldNotesLabel is clicked on.

Thanks in advance for your help!

magmike
0
magmike
1/2/2008 9:43:05 PM
access.formscoding 7493 articles. 0 followers. Follow

0 Replies
751 Views

Similar Articles

[PageSpeed] 22

Reply:

Similar Artilces:

Conditional format #12
Hi. I am trying to set a conditional format. If NETWORKDAYS(A1,TODAY())> 3 I would like the cell to format with red shading. How do is set the formula in the condtional statement? I tried ="NETWORKDAYS(A1,TODAY())>3" , but this doesn't seem to work. Thanks, Mike. Hi Mike! It doesn't work because the NETWORKDAYS function is in another workbook (the Analysis ToolPak add-in). You can use a workaround by putting your condition in a separate cell (eg B1) and then referring to that cell: B1 =NETWORKDAYS(A1,TODAY()) Then your conditional format for A1 becomes:...

how can I type up a consent form
I need to make one because my son is going out of state with his grandmother and I need to get one made up fast so that if anything goes wrong she can sign for him at the E.R. Hardly an excel problem. -- Don Guillett SalesAid Software dguillett1@austin.rr.com "Danie" <Danie@discussions.microsoft.com> wrote in message news:99852E7D-DDBF-4CFA-953E-80A4B37BCA4E@microsoft.com... >I need to make one because my son is going out of state with his >grandmother > and I need to get one made up fast so that if anything goes wrong she can > sign for him at the E.R. W...

Merging List w/ a Form
Can anyone assist me with merging a form created in Excel with a database (or list) also created in Excel? I know how to merge an Excel worksheet to be used as a database for Word in the Mail Merge command, but my FORM, with which I am trying to merge my database, was created in Excel and needs to remain under its format (not be converted to Word). I am filtering the information I need from the database to be imported to the Excel Form. Any help would be appreciated. Thank-you. If you're trying to display information from one record in the database, there are sample files here...

How do I make numbers become text?
I am trying to create a spreadsheet where numbers entered in one location become text in another. I tried the Help option, but I am still lost. Please help, and thank you. From earlier postings: How to Convert a Numeric Value into English Words http://support.microsoft.com/default.aspx?scid=KB;EN- US;140704& and: (courtesy of a cut and paste from a Tom Ogilvy post): If you want an addin that provides a worksheet function that does this, download Laurent Longre's free morefunc.xll addin found here: http://longre.free.fr/english/ It is downloaded in a zip file which also conta...

Publisher has turned yellow. How do I make it white again??
When I open Publisher, it seems to have aquired its own colour scheme - the blank page is yellow. How do I make it white again? I have searched all the menus but cannot find anything that helps. It's driving me mad!! It only happened in the last few weeks, and I've no idea what I did to change it. I'm usung Publisher 2000. A small child turns to Ed, and exclaims: "Look! Look! A post from butterflyj <butterflyj@discussions.microsoft.com>!"... > When I open Publisher, it seems to have aquired its own colour > scheme - the blank page is yellow. How do I ma...

making items available on website
Is there a way to 'make items available on the website' other than going into each items properties under the Options Tab and checking the box? I would like to make quite a few items available at one time if possible. Thanks for any help. Craig This is a multi-part message in MIME format. ------=_NextPart_000_0465_01C72051.D97BD680 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Craig, Backup first!! This will set _all_ items as available for web sales except those that = are marked inactive. UPDATE Item SET WebItem =...

Conditional Format #20
I see that I can only use 3 conditional formats. I need a few more than 3 is there any way to do this. Kevin Try this free add-in on Bob Phillips' website: http://www.xldynamic.com/source/xld.CFPlus.Download.html Another possibility (albeit limited) is to combine your conditional formats with custom formatting. See J.E. McGimpsey's site for an example: http://www.mcgimpsey.com/excel/conditional6.html HTH Jason Atlanta, GA >-----Original Message----- >I see that I can only use 3 conditional formats. I need a few more than 3 is >there any way to do this. > >Kev...

Want to make complex header on 2nd and 3rd page
I need to make a quotation which consists of a first page, thats fully on its own and then two pages which has a same header. The header, though, consists of quite a lot of text and also a company logo and that was byond the header functionality. How to get the 2nd and 3rd pages with a complex upper part? Bart Exc 2003 ...

Condition navigating between Controls
I have a form in access 2007, with several controls. I used the On Exit Event Procedure for navigating among controls. Example: If Method of Payment = “Check” Then Check No.Set Focus End If If Method of Payment = “Credit Card” Then Credit Card Name.Set Focus End If End Sub And so on for all controls. Form functioned well for months, however today went wild. Navigation order does not execute Event Procedure it follows exactly the order of TAB ORDER DIALOG BOX. Please advice -- Bardia It sounds like the On Exit event is not firing for some reason. Put these two lines of co...

Filter Report by Form
I'm using the following code from the wonderful Allen Browne which works perfectly in an either or scenario (either by Start/End Date(s) OR filtering by client name; but I don't know what syntax to use to filter by Start/End date(s) AND anything typed in the client name field. I'm sure it's easy but I can't get my head around it. I appreciate any and all assistance!! Private Sub cmdPreview_Click() 'On Error GoTo Err_Handler 'Remove the single quote from start of this line once you have it working. 'Purpose: Filter a report to a date r...

Button on Form to Run Report based on Query with Parameters
Hi Guys. I am busy working on a stock control database (and job control). When I have a Form Open, it shows several fields, including JobID (Which is the PK for that job) (frm_Invoicing) I also have a Query that when Run, it prompts for the JobIDNo. (qry_CustJobsInvStock) I have a report based on that query. (rpt_CustJobsInvStock) I have added a button onto the form (onclick -> DoCmd.OpenReport) to open and automatically print the report, But I just cannot figure out how to get it to get my JobID from the form, and to Automatically add it as a Parameter for the que...

Center Access2007 Form in the middle of access Main Window
Thank You Is there any easy way to center access 2007 forms in the middle of the screen (Monitor) or access main window. and give me good result Hello, I think there is no built in feature to achieve this goal. You may need to create a new form and configure it as the main window. You could enumerate forms and create buttons etc to open forms from this main form. For example, you could use hte following code enumerate forms in your database: Dim db As Database Set db = CurrentDb Set cntContainer = db.Containers("Forms") For Each doc In cntContainer.Documents Str...

Printout Method
In building a form to allow users to print a "blank form" I've constructed as an Access Report, I'd like the user to be able to select the number of copies to print. It looks like the PrintOut Method would be a good choice for this, but I'm not smart enough to know quite how to get the "Copies" argument to get its input from the textbox on my form, where the user will enter the number of copies they'd like to print. Suggestions? -- Thanks, Croy Does the report have a record source? -- Duane Hookom Microsoft Access MVP If I have helped you, please help...

Conditional formatting / blank cells
Hello, I need help with a Conditional Format. This is my worksheet. Row 4 A B C D E F G H I $200 $210 I want a conditional format in G4 that states if G4 is greater than or equal to F4 the fill colour is green. If G4 is less than F4, the fill colour is red. If G4 is blank, the fill colour is white. I've tried numerous combinations, but cannot seem to get this to work. Thanks torkattack. Test for the blank first. -- David Biddulph "torkattack" <torkattack@discussions.microsoft.com> wrote ...

making my own reports......
I am doing a mailshot next month and i have several customertypeid's set up for all my different customers, i have a report which shows everything i need (|Customer name, address1,address2,state,zip,country) but i want account type id to be available on the report so i can filter it accordingly, when i add the following to the report i get errors - can anyone help? If i just plonk this into a customer list report should it work? I did this to add the country colum to my reports and it worked ok! Begin Column FieldName = "AccountTypeID" DrillDownFieldName = "&qu...

email form script to show email adresses of all recipients
I see there is a field in the attributes called torecipients but I cannot add it to the email form. Is there a way I can script this into the email form to show the email addresses of all of the recipients. My idea involved creting a new attribute called all_recipients and adding it to the form then doing a onchange for each of the to, cc, and bcc fields to update all_recipients. SO far it doesnt work. All the field returns is "undefined". Any help is greatly appreciated!!! ...

Conditional formatting formula with multiple criteria
Hi all, Have been puzzling over this for a while now, and can't get it right! Using conditional formatting, I want to: If any of the cells in Column B are blank, and the cells in Column C are blank, and the date in Column D is less than todays date - 3 days, turn the cell bold and red Can someone please help? I have tried all different variations and just can't get it! Thanks, Kirstie Kirstie Your questions sound like you wish to pick up whether there is a blank ANYWHERE in column B AND (not or) ALL cells in column C are blank AND that the date in a single cell in colum...

Using conditions in WF Sales Processes
I'm creating a workflow process that I am trying to implement in MSCRM. The problem is that within each Stage, I have activities that should be dependent on the completion of the previous activity. The easiest way to solve this is to go beyond the 5 step Sales Process and create a new Stage for each successive activity. However, in the Sales Process tab this is quite unsightly. I've tried using a normal manual WF as a subprocess to the Sales Process WF. This works, but it gives me 2 problems: 1. The WF Subprocess does not appear in the Opportunity Sales Process Tab. The customer want...

Fill Form And Get $5000 To Your Home.
Fill Form And Get $5000 To Your Home At http://ukcitygirls.co.cc Due to high security risks,i have hidden the cheque link in an image. in that website on left side below search box, click on image and enter your name and address where you want to receive your cheque. please don't tell to anyone. ...

formula for visible cells
Can I copy a worksheet so that the new worksheet looks exactly like the visible portion of the old worksheet. For example, if I filter and sort, I only want what is left visible to appear in my new worksheet, and I want it to do it automatically without my having to copy and paste. Automatic means VBA code. See Ron de Bruin's site for copying filtered results. http://www.rondebruin.nl/copy5.htm Gord Dibben MS Excel MVP On Tue, 4 May 2010 11:32:01 -0700, jpstormy <jpstormy@discussions.microsoft.com> wrote: >Can I copy a worksheet so that the new workshee...

Updated records in forms
Each record in a form is a work order. School, contractor, days of work, etc. I have a pop up calendar to select a week ending date for each record. Record 1's week ending date is Nov 13, 2009. Record 2's week ending date is Nov 20, 2009. When I change the date in record 2, it's changing the date in record 1. Each record's week ending date become all records' week ending date? Can I use a pop up calendar in a record and be able to retain the correct week ending date for each record. If so, how would I be able to accomplish this? Thanks for your inp...

requery subform from sub form
Thank you how can i requery subform from subform ? "a" <youb@hotmail.com> wrote in message news:%23R9c$8tSIHA.2000@TK2MSFTNGP05.phx.gbl... > Thank you > how can i requery subform from subform ? Me.Parent!Subform2ControlName.Form.ReQuery thank you the work correctly "Stuart McCall" <smccall@myunrealbox.com> wrote in message news:fl83eg$3o6$1$8300dec7@news.demon.co.uk... > "a" <youb@hotmail.com> wrote in message > news:%23R9c$8tSIHA.2000@TK2MSFTNGP05.phx.gbl... >> Thank you >> how can i requery subform from subfo...

Conditional Formatting
I am using the below to auto change color if it meets the condition... =IF(F26>=0,IF(OR((F26)<=2,(F26)>=-1),"GREEN", IF(AND((F26)<=2.5,(F26)<=-1.5),"AMBER","RED")), IF(AND((F26)>=2,(F26)<=-1),"GREEN", IF(AND((F26)>=2.5,(F26)>=-1.5),"AMBER","RED"))) Any help is appreciated. -- J~ In 2003, when you set up a conditional format, you can choose one color for the condition. If you want to do something like what you are showing, you're going to need to use a Worksheet_Change event and code something ...

conditional format of data tables in charts
I've created a chart that is based on a data set where the cells have conditional formatting (if value a > value b then colour the cell red) I have the data table displayed with the chart (in chart options, 'show data table' is ticked), but the condtional formatting is not displayed in this table, i.e cells that are red in my original data set are not coloured in the chart table. Is there any way to apply the conditional format on the table displayed within the chart? Cheers Dan. Daniel, Unfortunately you can't apply conditional formating to data tables. However, yo...

How can I make this happen?
I want a macro or something that will allow me to "show" every comment on a work sheet (there are almost 100) then go to Format Comment and Properties and change it to "move and size with cells" then rehide the comment. Any ideas? -- foxspirit ------------------------------------------------------------------------ foxspirit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=31264 View this thread: http://www.excelforum.com/showthread.php?threadid=509350 On a worksheet is there a function that unhides all comments in every cell? -- foxsp...