Message box error check box

I have built a databse, on a form i have a close  button i want to do
a few checks to see if certain text boxes have data in them. I would
want message box and then i want it to set focus to that box ( and
highty llight it in red if pos)

I have about 10 checks to do on every form that the best way to do
this

0
Simon
12/25/2009 5:51:41 PM
access 16762 articles. 3 followers. Follow

1 Replies
708 Views

Similar Articles

[PageSpeed] 51

"Simon" <S.Dickson@shos.co.uk> wrote in message 
news:f628c1d7-0598-4d75-bc3a-6c41df313870@m16g2000yqc.googlegroups.com...
>I have built a databse, on a form i have a close  button i want to do
> a few checks to see if certain text boxes have data in them. I would
> want message box and then i want it to set focus to that box ( and
> highty llight it in red if pos)
>
> I have about 10 checks to do on every form that the best way to do
> this

Add something like a "2" to the Tag property of the textboxes you want to 
check. Try using the code below in a standard module:

Public Sub CheckIt(frm As Form)
'�  Arvin Meyer 12/25/09
' Free use permitted if copyright left intact
On Error Resume Next

Dim ctl As Control

    For Each ctl In frm.Controls
        With ctl
                If .ControlType = acTextBox Then
                    If ctl.Tag = 2 Then
                        MsgBox "Please fill in the required data", vbOKOnly, 
"Data Required"
                        ctl.SetFocus
                        Exit Sub
                    End If
                End If
        End With
    Next ctl

Set ctl = Nothing
Set frm = Nothing

End Sub

Call it like:

Private Sub Form_BeforeUpdate(Cancel As Integer)
    CheckIt(Me)
End Sub

-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


0
Arvin
12/25/2009 8:08:46 PM
Reply:

Similar Artilces:

Outlook 2000 Error #11
I had to re-install Windows and all programs and now when I try to send/receive mail through Outlook 2000 it gives me the message that Internet Mail is not regestered properly. Please re-install and try again. I use the Office 2000 CD and have used the repair function to re- install and finally totally un-install and re-install and I always get the same message. I am running Windows 98SE. It worked fine before I had to re-install. Any ideas or suggestions? Thanks for all of your help and input. Dale ...

Strange error.
I'm working with an OLEDB connection to a Microsoft Access database, coding in VB.net ' Connection String is set here (called from constructor) Private Function GetConnection() As OleDb.OleDbConnection Return New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB. 4.0;" _ & "Data Source=" & mDataPath & "\DAQ.mdb") End Function ' Sub that's throwing the error: Public Sub insertStart(ByVal sTime As Date, ByVal jobID As Integer) Dim sql As String = "EXECUTE startTheor" insCmd = New Ole...

Saving messages in OE V6
Can I save out messages in outlook as I can with the address book ??? Hi, Alan - This is a group to support Outlook from the Office group of programs. Outlook Express is a part of Internet Explorer and is a quite different program, despite its similar name.. You will probably get a faster and more expert answer if you post this to an Outlook Express news group. Try posting in one of these newsgroups: microsoft.public.windows.inetexplorer.ie5.outlookexpress for OE 5.x microsoft.public.windows.inetexplorer.ie55.outlookexpress for OE 5.5x microsoft.public.windows.inetexplorer.ie6_outlookexpr...

what is the best way to organize incoming messages?
Some people use their Inbox to hold only messages still requiring some action on their part, and therefore delete or transfer the messages once read and/or replied to. While this approach has the advantage of keeping a neat and clean Inbox, it makes for more work than my current approach. I currently leave all incoming messages in my Inbox except for Junk, including messages that I've read, not read, responded to and not responded to. This allows simplified sorting and finding of messages (by sender, subject, date, etc.) and seems to work for me. But I am curious if I am missing...

Invalid month in Project Accounting error
When entering the project number in the Billing Entry screen in Project Accounting, I receive the following error: Unhandled script exception: Invalid month '0' in date function. Script terminated. EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE SCRIPT_CMD_SETDATE This is currently only happening for one particular customer. I can't find anything in the knowledge base. Does anyone have a solution. Thanks, Eric ...

How to prevent messages that fail reverse DNS?
Can anyone point me to a solution for rejecting messages that fail reverse dns lookup? I know there is a check box to "enable" reverse dns lookups, but it only "marks" messages as failed - it doesn't reject them. Any help is appreciated. "Todd R" <todd@fofz.com> wrote: >Can anyone point me to a solution for rejecting messages >that fail reverse dns lookup? I know there is a check box >to "enable" reverse dns lookups, but it only "marks" >messages as failed - it doesn't reject them. Try Open Relay Filter (...

can not send without error code
Hi, kindly help me. Out of sudden I can not send my email, but I still can receive email. My outgoing email just sitting in the outbox. I try send and receive several times, there is no error code but they only receiving without even try to send I do not change anything in the setting and even truy to recheck all the setting (SMTP, etc) and everything still ok need your immediate response, many thanks in advance How to Remove a Stuck Undeletable Message in Windows Mail http://www.vistax64.com/tutorials/62560-windows-mail-problems.html WMUtil http://www.oehelp.com/WMUtil/De...

Calculate As of Date Check Book Opening Balance
Hi Is there any way to calculate as of opening and closing balance of a given check for Payments and Deposits Listing report Module = Banak Management Regards Irfan ...

text box #7
I have created a text box, but when I type in something, and hit enter, I get the error message "REFERENCE NOT VALID". Please help. Thank you We require some more details. Where have you created the textbox, in the sheet or a userform. Are you using the control from the Control Toolbox menu. Are there any macros you are using. Mangesh "Marlis" <Marlis@discussions.microsoft.com> wrote in message news:6C6C6F42-E6CB-4DEB-BB46-C8F923A343C0@microsoft.com... > I have created a text box, but when I type in something, and hit enter, I get > the error message "...

TCP/IP error message
After moving and changing my account, I started getting an error message when sending a email saying that the TCP/IP conncection has been unexpectely terminated. However the message his being sent but it remains in my outbox. The service provider (SBC) is telling me it is an Outlook issue. Any ideas ? You might have to reset the tcp/ip "JP Peretz" <jpregs@sbcglobal.net> wrote in message news:1abc01c3fbff$9e6d47a0$a001280a@phx.gbl... > After moving and changing my account, I started getting > an error message when sending a email saying that the > TCP/IP connc...

Outlook Error after URL change
We have already configured our internal DNS records to support crm.domain.com to point to the proper machine, and created the host headers on the web server. How do we get CRM to switch from "server1" to crm.domain.com? In a nutshell, we renamed the server from an internal name to a FQDN. Internally the CRM server still believes it is on http://server1 We are trying to access it now on http;//crm.domain.com. Our outlook worked properly before we made this change. After the change, only the web works and the outlook after a uninstall and reinstall, switching the server name whil...

X.400 message DDA configuration procedure
I am having the problem exactly described in this article: http://support.microsoft.com/default.aspx?scid=kb;en- us;160947&Product=ech The resolution is: Configure the X.400 message so that the DDA type and DDA value are not null. The maximum value for the DDA type is 8 and the maximum value for the DDA value is 128. I was not able to find the proper procedure for that fix in the Knowledge Database nor in MS's Exchange 5.5 Guides. Any help is very appreciated, Thanks in advance This is a multi-part message in MIME format. ------=_NextPart_000_017B_01C3BB11.DF73EB20 Content-Ty...

# DIV/0! error in Excel
I have a function that divides two numbers, sometimes those numbers are 0 so the result is # DIV/0!. My second function is based on the result of the first function. Since there isnt always data available for the first function I get the # DIV/0! error and my final calculation wont calculate. I need the final calculation to disregard any 0 cells or # DIV/0! errors and still calculate the data that is available. Hi You need to wrap your division with an IF() so it will evalluate the result before it puts anything in the cell. Try something like: =IF(A2>0,A3/A2,0) -- Andy. "He...

Timeout error in incident.update
I have an incident.update line in my post callout. No matter how simple the update strIncidentXml is, I always get timeout error from the server. Afterwards I changed my mind and decided to use SQL update statement to update the incidentbase table. Again I get timeout expired message (ErrorMessage: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding) What can be causing this? Why am I not being able to update incidents? Thanks in advance for your ideas. ...

Installing CRM3, multiple errors
I have installed CRM3 on a clean SBS2003 machine (under VirtualPC), but have got a series of errors and cannot now acess CRM at all. I followed the steps in the Implmentation Guide. I had to change the web site port to be 80 and the alias to be able to access it (as crm3demo). I installed CRM3 under Administrator login and was initially able to open CRM correctly, login as Administrator, go into the Administrator user and uncheck the restricted access check box. Everything appeared normal. Then I set up the sample data users in Active Directory and tried installing the sample data by ...

Exchange 5.5 Error Message "Application Log Full"
This is the relavent information from the Application Log: Event ID: 2125 Source: MSExchnageMTA Type: Warning Catagory: Resource Description: Statistics for the DBI call (DB Server): file writes GATEWAY, reads 37, cache hits 275, misses %5. Attribute %6, value number %7, Object ID: %8 (00000000 => N/A). Caller %12 [%9 %10 %11] (8) I'm having a hard time making sense of this error message. Vaguely, it looks like a system call to a DB server that is misbehaving in some way. I've tried restarting the MSExchangeMTA service, to no avail. Can somone point me in the right dire...

empty messages in Outlook Express
Anyone got any ideas on this. Today all my email messages appeared to be blank, although attachement, headers and file size remain. To complicate things further, I can no longer recv or send email, I get the following message. Any ideas? Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Account: 'Annon BT account', Server: 'mail.btopenworld.com', Protocol: POP3, Server Response: '+OK 1487 octets', Port: 110, Secure (SSL): No, Error Number: 0x800CCC0F And...

VC++ 2005
I am attempting to compile a project in Visual Studio 2005 which compiles and links properly in VC++ 6.0. It seems to have problems with C++ i/o functions. Here is the error I get: g:\src\analyzer\digitdialpages.h(136) : error C2146: syntax error : missing ';' before identifier 'm_InFile' Line 136: ifstream m_InFile; The statment: include <fstream> is at the top of the source file. Some assistance would be helpful. We didn't have any problems with using ifstream or ofstream in VC++ 6.0. Thanks. On Tue, 12 Dec 2006 18:22:47 -0500, "Raj Kulkarni...

Message Tracking #4
Hi, I've got Exchange 2K SP3 installed on a Win2K SP4 server. I've got message tracking enabled. One of my users was to receive an email from someone outside the company. I tracked the message and found it in the message tracking center. The destination user was mispelled and an NDR was returned. Since I found the message in the message tracking center... is there a way to read that message from there or forward it to the user? I told the user to just have the person resend it with the correct spelling, but I'm still interested in knowing if I could've just forwarded or read t...

How do I get my new messages to populate when they arrive?
My new email messages do not show up in my inbox until I go to another folder and then back to the inbox folder. Then they show up. issue #2 I get a copy of my reply email in my inbox. How do I stop this? Do you have a firewall between you and your server? -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP Roland Schorr & Tower http://www.rolandschorr.com Microsoft OneNote FAQ: http://www.factplace.com/onenotefaq.htm **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! "Lonnie" <Lonnie...

Add Movie to Outlook E-Mail Message via "Web Tools" toolbar--question
Using Outlook 2003 (in fact all of Microsoft Office 2003), and have Word selected as e-mail editor. Windows XP Pro with all updates. Recently I discovered on the Office web site a way to insert a movie (inline) to an e-mail message. I have one question about its implementation. If (in an HTML-formatted e-mail, and Word selected as e-mail editor) with the cursor in the body of the message, you click on "View", "Toolbars", you can select a toolbar called "Web Tools". On that is an icon that says "Movie". If you click on it you can add a movie to the e-ma...

Reconcile Voided Checks
I just noticed that my Bank Rec balance after reconciling my checks is not matching my GL balance for that account. It appears that the balance is off from 3 voided checks. It seems that the Bank Rec module doesn't take into account these voided checks when reconciling the account. Does anyone know how to get these reflected so it matches? Is bank rec listing the checks as not being voided or is gl still showing the checks? I would also look at the date the checks were voided and make sure it is before your cutoff date on the bank rec. "ryan" wrote: > I just notic...

Strange error...
Hi All, I have following 2 files in my project. //MLCommand.h typedef struct { char Name[25]; // Command Name BYTE numParams; // Number of Parameters void *params[ML_MAX_PARAMS]; }ML_Command; //MLC.h class ML { public: ....... ....... static ML_Error Configure (LPCTSTR INIFILE, void (*statusTarget)(char*,int,int)); static ML_Error SetTraceLevel (BYTE traceLevel); static ML_Error SetPortAndWindowHandle (char* PortName, HWND hwnd); ...... ...... }; when I compile the project I am getting following errors: mlcommand.h(23) : error C2146: syntax error : missing ';' before identifie...

Microsoft Outlook 2000 Error Report
Hi, Just to get helps on the following : I've the Microsoft Outlook 2000 (come with Ms Office 2000 Premium with full installation) installed on the Windows XP Professional with Service Pack 1. Had configured the corporate Internet Email as well. The problem is when sometime trying to type a new or replied or forwarding of email which is going to be send out, then will prompt the error report message. After i click on do not send, then it will straight away closed the whole Outlook 2000 application & the mail without saved the message. So i've to re-open again and re-type...

Error - Did not CLose Before Exiting
I'm receiving an error.. "...did not close the file before exiting" Money needs to verify the information in your file When I click Yes I then recevie the error.... "The email address or Password is in correct" ....if you are opening an existing file, sign in without access to online services. I know the password is correct as I have not changed it and it works with an older version of this file(from 1-month ago). I've tried to repair the current file, but was unsuccessful How can I sign in offline? Hello: My recommendation is to restore a ...