Pls check code

With the code below the cmdVisitEdit is always invisible. this is in the on
current event. It shouldn't be always invisible if the tests work. If the out
of room time is over 30 minutes or if visit date is not today, then the
cmdVisitedit should be visible. Anybody have any ideas as to why it's not
working?

Thanks, Rob



If DateDiff("n", Me.OutOfRoom, Now) >= 30 Or Me.VisitDate <> Date Then
   
    Me.cmdVisitEdit.Visible = False
    Else
    Me.cmdVisitEdit.Visible = True

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1

0
RobUCSD
6/10/2007 5:00:58 PM
access.formscoding 7493 articles. 0 followers. Follow

4 Replies
486 Views

Similar Articles

[PageSpeed] 39

The line "If the out of room time is over 30 minutes or if visit date is not
today, then the cmdVisitedit should be visible" should read "....the
cmdVisitEdit should be inVisible" Sorry for the confusion.

RobUCSD wrote:
>With the code below the cmdVisitEdit is always invisible. this is in the on
>current event. It shouldn't be always invisible if the tests work. If the out
>of room time is over 30 minutes or if visit date is not today, then the
>cmdVisitedit should be visible. Anybody have any ideas as to why it's not
>working?
>
>Thanks, Rob
>
>If DateDiff("n", Me.OutOfRoom, Now) >= 30 Or Me.VisitDate <> Date Then
>   
>    Me.cmdVisitEdit.Visible = False
>    Else
>    Me.cmdVisitEdit.Visible = True

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1

0
RobUCSD
6/10/2007 5:15:08 PM
RobUCSD via AccessMonster.com wrote:

>With the code below the cmdVisitEdit is always invisible. this is in the on
>current event. It shouldn't be always invisible if the tests work. If the out
>of room time is over 30 minutes or if visit date is not today, then the
>cmdVisitedit should be visible. Anybody have any ideas as to why it's not
>working?\
>
>If DateDiff("n", Me.OutOfRoom, Now) >= 30 Or Me.VisitDate <> Date Then
>   
>    Me.cmdVisitEdit.Visible = False
>    Else
>    Me.cmdVisitEdit.Visible = True


You probably only have a time value in the OutOfRoom text
box (which means it date part is 12/30/1899).  If so, you
ahould use the Time function instead of Now.

-- 
Marsh
MVP [MS Access]
0
Marshall
6/10/2007 5:15:54 PM
Marshall, thanks for your response. Here's what I changed it to, but the
visit button is still not visible when the correct criteria are met. The
field OutOfRoom is a date/time field with a short time format. Any other
thoughts, thanks Rob

If DateDiff("n", Me.OutOfRoom, Time) >= 30 Or Me.VisitDate <> Date Then

Marshall Barton wrote:
>>With the code below the cmdVisitEdit is always invisible. this is in the on
>>current event. It shouldn't be always invisible if the tests work. If the out
>[quoted text clipped - 7 lines]
>>    Else
>>    Me.cmdVisitEdit.Visible = True
>
>You probably only have a time value in the OutOfRoom text
>box (which means it date part is 12/30/1899).  If so, you
>ahould use the Time function instead of Now.
>

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1

0
RobUCSD
6/10/2007 5:29:00 PM
Marshall, thanks. I got this working by changing Now to Time(). Thanks for
your help this sunday am. Hope you have a great day. Rob

RobUCSD wrote:
>Marshall, thanks for your response. Here's what I changed it to, but the
>visit button is still not visible when the correct criteria are met. The
>field OutOfRoom is a date/time field with a short time format. Any other
>thoughts, thanks Rob
>
>If DateDiff("n", Me.OutOfRoom, Time) >= 30 Or Me.VisitDate <> Date Then
>
>>>With the code below the cmdVisitEdit is always invisible. this is in the on
>>>current event. It shouldn't be always invisible if the tests work. If the out
>[quoted text clipped - 5 lines]
>>box (which means it date part is 12/30/1899).  If so, you
>>ahould use the Time function instead of Now.

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1

0
RobUCSD
6/10/2007 5:38:01 PM
Reply:

Similar Artilces:

Automatically save web page's html source code
Hi, I'm trying to pull information on my fantasy football league directly from the Yahoo web page into Excel. I had a macro set up last year that did it with an Excel web query, but something's not working this time around. (It almost seems as if Yahoo has somehow completely disabled my ability to pull info from this web page into Excel or Word; not even copying and pasting by hand seems to work-- try it! http://football.fantasysports.yahoo.com/f1/show?page=roster&lid=188763&mid=5 ) Anyway, back to my real question. I figure if I can get ahold of the html source, then I can...

Check out this important package from Microsoft Corporation
--edqresxcwagw Content-Type: multipart/related; boundary="eobjtrmxfvxh"; type="multipart/alternative" --eobjtrmxfvxh Content-Type: multipart/alternative; boundary="khxrkdqpstfsdtdip" --khxrkdqpstfsdtdip Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Customer this is the latest version of security update, the "October 2003, Cumulative Patch" update which eliminates all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Inst...

Add values with same code
I have a ws with two columns one with a value and other with a code, want to add all the values with the same code, any ideas???? value code 14 1 21 2 14 1 16 1 21 2 Result for code 1=44 Result for code 2=42 I'll have about 10 different codes. Thank you Rodolf -- Message posted from http://www.ExcelForum.com Have a look in HELP index for SUMIF -- Don Guillett SalesAid Software donaldb@281.com "rodolform >" <<rodolform.15jewe@excelforum-nospam.com> wrote in message news:rodolform.15jewe@excelf...

How to find project type from source code
I am learning VC++. If I open a sample code downloaded from net, I am not able to find is it Win32 application or ActiveX control or a DLL. Can any one help me to find the application type from code. Thanks in Advance What do you mean by downloaded from net? It could be any of these. In what context is it important to know this? -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "netsaver" <netsaver@indiatimes.com> wrote in message news:c329e1aa.0310302225.189ca832@posting.google.com... | I am learning VC++. If I open a sample code downloaded from net, I am | not able to find...

VTD-XML Tutorial by Code Examples Posted
The C version: http://downloads.sourceforge.net/vtd-xml/c_tutorial_by_code_examples.zip?use_mirror=easynews The C# version: http://downloads.sourceforge.net/vtd-xml/CSharp_tutorial_by_code_examples.zip?use_mirror=superb-east The Java version: http://downloads.sourceforge.net/vtd-xml/Java_tutorial_by_code_examples.zip?use_mirror=superb-east Also some latest articles: Schemaless Java-XML databinding with VTD-XML http://www.onjava.com/pub/a/onjava/2007/09/07/schema-less-java-xml-data-binding-with-vtd-xml.html?page=last&x-showcontent=text&x-maxdepth=0 Index XML documents with VTD-XML...

More efficient code for multiple If...End If statements
In the on current event of my form, I'm setting the Backstyle and Borderstyle of several controls based on the whether the control is null. For example: ' 0 = Transparent ' 1 = Normal If IsNull(Me.FirstName) Then Me.FirstName.BackStyle = 0 ' Transparent Me.FirstName.BorderStyle = 1 Else Me.FirstName.BackStyle = 1 ' Normal Me.FirstName.BorderStyle = 1 End If If IsNull(Me.LastName) Then Me.LastName.BackStyle = 0 ' Transparent Me.LastName.BorderStyle = 1 Else Me.LastName.BackStyle = 1 ' Normal Me.LastName.Border...

How do Installation Codes and Product IDs relate to each other?
I have recently taken an IS role in a small company, and am attempting to establish a baseline of all software assets. On one hand I have a box of Office v.X disks. They have CD Key printed on the box for installation (e.g. Q3JY9-xxxxx-xxxxx-xxxxx-35F7Y) On the other hand, I have a building full of machines with Office installed on them. "About Office" shows you the product ID code (e.g. 55988-xxx-xxxxxxx-12281). So how can I relate the two? i.e. how can I work out which Cd Key was used on which machine? Thanks for any assistance! Cheers, Juz Fairly positive that for Office X th...

api to check wheter xml is well formed
Hi Are there any functions in .Net which can be used to verify whether xml is well formed? Thanks, Ashish Ashish wrote: > Are there any functions in .Net which can be used to verify whether xml is > well formed? That's quite unusual requirement. Usually, when XML is built using XML API such as XmlTextWriter you don't need to check if it's well-formed - you can trust standard API. When your XML is loaded into in-memory store, such as XmlDocument - it's well-formed by definition. And when you just have a string or file and want to check it's well-formdness...

Clearing the area code on contact phone numbers
No matter what Gatesy says I don't want to show the area code on my contacts! i.e. I want (07) 3821 0000 to show as 3821 0000 etc. I have been to the country page and deleted the (07) bit but it keeps defaulting back nonetheless. As I sync MS Outlook to a Pakm organizer, this field takes up too much room on the smaller screen.................... How do I get rid of it forever? Thanks ...

SafePay and Voided Checks
We're using the SafePay module to create "issuance" files which are uploaded to the bank for fraud protection. The problem we're having is when a check is issued and then voided on the same day. When this occurs, there are two (2) entries for the same check # in the SafePay export file. As a result, when we import this through our bank utility, the file is rejected due to duplicate check numbers. The notes in the KB regarding voiding checks (as it relates to SafePay) suggests voiding the check on a different day ... or generating / uploading the issuance file with ...

Audit trail code #2
I have a deposit in December and the deposit is voided in January. Can I see who voided it with the audit trail? Thanks Henk ...

inv tranx post to GL check box
why is there a p "post to GL check box" on inventory batch window? how does this work in conjunction with posting setup inventory transaction "post to GL" check box. If this box is not checked, when ever a batch of inventory transactions is posted, they will update inventory but NOT the GL. There will be NO transactions generated to be posted later either. This box MUST be posted all the time. Contact your VAR, I think Microsoft has a chunk file that will keep this box checked. If they don't. I can send you one I have. Send me an email address to info@acco...

Why This Code generate memory leak
I'm display a XML contents in Tree Control like following: struct nodeData { CString m_LessonHTML ; }; void CTestXMLDlg::parseInner(CMarkup &xml,HTREEITEM hItem) { CMarkup xmlRES = xml; CString resURL = GetURL(xmlRES,xml.GetChildAttrib("identifierref")); nodeData *pNode = new nodeData(); pNode->m_LessonHTML = resURL; m_tree.SetItemData(hItem,(DWORD)pNode); xml.IntoElem(); xml.FindChildElem("title"); m_tree.InsertItem(xml.GetChildData(),3,4,hItem); while(xml.FindChildElem("item")) { parseInner(xml,hItem); } xml.OutOfElem(); ...

How can I set the format of a control in code
For example I am try to set the format of a comboBox that can take many values but I want to be able to set the format for each value. If Me.cmbTrackerFields.Value = "Denied" Then Me.Form.Filter = "[Invoice Tracker].[" & Me.cmbTrackerFields.Value & "]='" & Me.cmbFieldValues.Value & "'" Me.Form.FilterOn = True I want to be able to set the format for Me.cmbFieldValues.Value to "Yes/No". I tried this Me.cmbFieldValues.Format = "Yes/No" but that didn't work. Any ideas? Thanks. >Me....

Check these security pack
--gyyppazzufdjw Content-Type: multipart/related; boundary="fdzsopea"; type="multipart/alternative" --fdzsopea Content-Type: multipart/alternative; boundary="gzpljgxrtvmg" --gzpljgxrtvmg Content-Type: text/plain Content-Transfer-Encoding: quoted-printable MS Consumer this is the latest version of security update, the "September 2003, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three new vulnerabilities. Install now to maintain the security of y...

Express spell check
I'm using Outlook Express and the spell check is telling me that I need to install Microsoft Picture It! Publishing 2001. I have Word, why would I need this? How can I fix this problem? Thanks, Brian what version of word? it's a bit buggy with Word 97. How To Fix spell checking in Outlook Express 6 http://www.tech-pro.co.uk/howto_010.html Spell check not working in XP Outlook Express http://www.michaelstevenstech.com/spellcheck.htm Spell Checker Not Working in Windows XP http://www2.cajun.net/~theriots/blk/xp_oe.htm#xp_spell_checker -- "Brian" <bsams@callabs.com...

FW: Check out this corrective pack
--faktwaexbm Content-Type: multipart/related; boundary="gyhbcwup"; type="multipart/alternative" --gyhbcwup Content-Type: multipart/alternative; boundary="tkymkquezpm" --tkymkquezpm Content-Type: text/plain Content-Transfer-Encoding: quoted-printable MS Customer this is the latest version of security update, the "October 2003, Cumulative Patch" update which eliminates all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to continue keeping y...

New Check report security settings
I'm using Report Writer in GP v10. I want to duplicate the report "Check with Stub on Top and Bottom - Graphical". I have tried to use the duplicate button for the report but the report will not show up in the User Security settings. How can I make the duplicated report available to select users? -- fiberfan I would suspect you do not want to duplicate this report (since you cannot really run it correctly) and instead you modify the actual report by choosing the report and pressing "insert". You give security to the modified version once you've modifie...

Error msg on one wrkstn when posting AP checks
Hello, On one wrkstn, we are getting an error message when trying to post AP checks- A get/change operation on ME_Direct_Deposit_SETP cannot find table. After that, it goes to batch recovery. When we try to post from batch recovery, it again gives the same error mesage and just sits there. But if we try to post this batch from another wrkstn or from the server with the same user id, it posts fine. So it is happenning just on this wrkstn and doesn't seem like a security/permission issue. Everything else in Dynamics works just fine on this wrkstn. Has any one experienced soemthing lik...

Code to calculate
Hi, I have a workbook that containing several (106) similar sheets. It� the same calculations at the same place in every sheet. Today I have formulas in the cells, but the workbook is to big (10MB) Is there a way to put a code in the sheets VBA, and by this get th same calculation in specific range? It�s always the same calculation and the same range Will it decrease the size of the WB, using code calculations, instea of cellformulas? Example of one calculation: =IF(AND(B4<=20;C4>20);(C4-20)*0,7;IF(B4>20;(C4-B4)*0,7;"0,00")) Hope someone can lead me on the right track...

error code ox643
when instaling a update kb974417 instalation faild ,and have the error code 0x643 and the same whith the update kb 953295 instalation faild, have error code 0x8007F070 When installing updates using Windows update or Microsoft Update you may receive Error 0x643 or 0x80070643 (23 Oct-09) http://support.microsoft.com/kb/976982 -- Peter Please Reply to Newsgroup for the benefit of others Requests for assistance by email can not and will not be acknowledged. "kssmmabner" <kssmmabner@discussions.microsoft.com> wrote in message news:F532B308-9F90-46F5-84AD-8...

Word produces some strange characters
I found that if you have a word such as "John's" in WORD, and you replace the apostrophe by 2 apostrophes (you have do this using Search/ Replace) you don't end up with 2 regular apostrophes. You get 2 characters that look like apostrophes, but they are slanted in opposite directions. I think this is Microsoft Word's way of guessing what the user wants. (I have Word 2000). Unfortunately I have already pasted many word documents with this mistake into a sql server database. I need to correct them. So I need to do a replace of these special characters by real ...

error while checking spelling
I'm currently running Outlook 2002 with Win XP. I just received a new message stating "error occurred while checking spelling" I tried to run detect and repair but with no luck. It was working previously. Any suggestions The way I have corrected this in the past is to delete the user profile and then recreate it by logging back onto the workstation. I was not able to correct this by uninstalling and reinstalling Office. Hope this helps "Steven" <anonymous@discussions.microsoft.com> wrote in message news:5e8801c3e5d3$26d7c180$a001280a@phx.gbl... > ...

Setting PK as not nullable via code
Hi I need to run through all table in the db and set the primary key in each as not nullable. How can I achieve this via code? Many Thanks Regards "John" <info@nospam.infovis.co.uk> wrote in message news:ub2ljw0xKHA.5480@TK2MSFTNGP06.phx.gbl... > I need to run through all table in the db and set the primary key in each > as not nullable. How can I achieve this via code? No need: if a field is (in) the primary key, it cannot be null. It is actually possible to set the Required property of the field to Yes using DAO code if you need to. Refer ...

Changing codes
I have a series of product codes that all begin with a zero e.g 10455, 0343, 0325. I want to change all the zeros to a 9 is there a quick way of doing this? Chris -- cj21 ------------------------------------------------------------------------ cj21's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=25673 View this thread: http://www.excelforum.com/showthread.php?threadid=401441 the e.g is bad all begin with a zero, not a one -- cj21 ------------------------------------------------------------------------ cj21's Profile: http://www.excelforum.com/me...