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
573 Views

Similar Articles

[PageSpeed] 35

"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:

e-mail messages, from outlook, to cd, how to
hello there, i have a few thousant e-mail messages in outlook maps. i want to save them, i would like to burn them on a cd. i would like to move them just by one klik of my mouse i can rename them one by one, and then put them in a new map on C disk, an than burn them on a cd, but i want to do them all by just one mouse klick. please can you help me. What are Outlook Maps?? All of your mail is contained in a file with a .pst extension. You can export your folders that you want saved to a .pst file and then burn that to CD (you will need to copy it back to your hard drive and remove the r...

Getting a Runtime error
When importing a csv file into in Inventory wizard 140 Change Item Ordering Info. I am getting Run-time Error"-2147217900(80040e14)': Incrrect syntax near 'WHE" When I click on OK it closes the Store Operations Manager Anyone have any ideas on how to fix this hi sherie, tell me the format of your file , what fields you are using. "Sherie" wrote: > When importing a csv file into in Inventory wizard 140 Change Item Ordering > Info. I am getting Run-time Error"-2147217900(80040e14)': Incrrect syntax > near 'WHE" > When I...

How do you make Inbox messages stay bold until opened?
While in the Inbox, new messages are bold. Just by "passing" by them, the bolding is removed and it appears the messages have been read. How do you make the message remain bold until the message is actually opened? Tools, options, other, Reading pane button - uncheck Mark as read when selection changes. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlo...

No message rules?
I just switched from Outlook express (which I really like) to Windows live mail. It did a very good job of finding my old contacts and messages, but I don't see my rules. I used to route incoming messages to specific folders based on sender or message title. I can't find the corresponding feature in Windows live mail. Am I just not looking in the right places or does Live mail just not offer the equivalent feature?? ED On the Menu Bar: Tools | Message Rules. Don't see the Menu Bar? The Alt button will temporally enable the Menu Bar, or click on the Menus ...

Reject messages with custom message?
A policy has dictated an account of a former employee respond to all incoming email messages with a custom note and not allow the messages to accumulate in the mailbox. In fact, for admin purposes it would be great if there was no longer a AD account and mailbox. Thank you, -Bob I suggest that you request a few thousand dollars to hire a programmer to write you a custom event sink so that you can comply with the policy. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "just bob" <kilbyfan-aol@net.com> wrote in message news:%23...

block messages
Hi all, can I block on Exch5.5 some inbound messages coming through X400 Connector. I have created Contact with internet email address (non AD user) I have tried Delivery restriction Tab to reject messages from specific mailbox (that Contact) in the internet, but it doesn't work. Is any solution, how to filter abc@abc.com on exch5.5 sp3 Thanks Marek On Wed, 22 Mar 2006 11:34:08 +0100, "Marek" <neco@necoteckaenco.com> wrote: >Hi all, >can I block on Exch5.5 some inbound messages coming through X400 Connector. >I have created Contact with internet email addr...

Combo Box Adding Button to edit list items
I have a form which is designed to enter information about jobs we have completed. It has 3 combo boxes for different types of contacts that are pulled from different tables. I want the user to be able to select from the list or add a new contact. I know they can right click on the drop down arrow for the combo box and select "Edit List Items" but I really would like to add a button next to each combo box that gives them that option. I have tried creating a button next to it that opens up the form for the contact and then a button on that newly opened form to save and clos...

Outlook message rules for sent message from me.
Greetings, There has always been a message rule I wanted, and never asked about. So now I will. I default a copy of all my send messages to the sent folder. They are marked at read... which is good, because if I send the message, I obviously read it. <grin> At times, I wish I could send the message to other folders. Example. I have a folder called "family". If I send a message to "family", I'd like to be able to put a copy in the "family" folder. I know you could do this, but the message is not marked as read. Thus, the folder is bolded/...

Run-time error '429' ActiveX component can't create object
Tried running the Payroll Update Engine and I am getting this error message. I have tried reinstalling it and still no luck. I have been able to run this update in the past, but not sure what has changed to cause this. Any ideas? ------=_NextPart_0001_5DCA272E Content-Type: text/plain Content-Transfer-Encoding: 7bit A 'new' PUE.exe file was temporarily posted on the tax update web site, but it was found to cause these Active X errors. About 10 days ago, the former (original) version of the PUE.exe was put back out on the web site. If you install the PUE.exe from the tax u...

Office 2003 and 2007 Word ignores certain spelling errors
I checked both versions (2003 and 2007) of Office Word to see if they recognized specific spelling errors. Spell checker seems to ignore any word that has certain characters embedded, like any number (0-9), asterisk, parenthesis, right brace, backslash, or left-arrow (shift apostrophe). When I'm banging along and I unintentionally hit a numeric key within a word, spell checker doesn't recognize the error. Why? Is there a fix for this? There's an option (in Word 2003, Tools > Options > Spelling & Grammar; in Word 2007, Office button > Word Options >...

Exchange 2003, lost messages and tracking
AD 2000 domain, single forest, single domain, single exchange site Exchange 2003 Windows 2003 Ent I have a strange problem going on here. I’ve been receiving complaints periodically about users not receiving message with xls attachments. I sent the user and myself 3 messages from a test yahoo account with sequential subjects (1,2,3…) and a .xls attachment. I received all 3 messages and attachments to my account. The user in question only received the 2nd and 3rd message with attachments. The message tracking center shows all 3 messages being delivered with the final entry being “S...

Outlook 2003 Error Message #8
When sending messages to my internal MS Exchange recipients I get this error message. "You do not have permission to send to this recipient." Any help or work around for this. I searched the MS Knowledge Base and could get this exact error to come up. Thanks. ...

Dictionary Assembly Generator (DAG) Errors
Hi all, I added a field in the SOP Entry window using the Modifier.Now I want to access it via the VS Tools. According to documentation, I have to create an Application Assembly using the DAG tool. But I am having trouble with the Dictionary Assembly Generator. I am in a dos window, in the SDK folder and issuing this command : dag.exe 0 "C:\Program Files\Microsoft Dynamics\GP$GP10\Dynamics.set" /F This command returns the following error : "Error: Cannot find Application.MicrosoftDynamicsGp.dll. Generate Application.MicrosoftDynamicsGp.dll before generating Application....

Message removal
I'm attempting to remove 3 messages that keep appearing in my Sync Issues / Server Failures folder. I delete them, and the next day they are back again. I've tried extracting them with the ExMerge utility, run in Archive mode to delete them from the store. It fails, and in the ExMerge.log file it says: [11:54:12] Error copying messages from folder '\Sync Issues\Server Failures' (MAPI_W_PARTIAL_COMPLETION) Any ideas how I can extract these messages? I would try disabling any AV on the machine you are running Exmerge on and see if that works. On Mon, 21 Feb 2005 09:42:...

number of messages in inbox
how to find the number of messages currently in my inbox? If you have the status bar enabled from the View menu and then highlight the folder the number of items is displayed in the status bar <anonymous@discussions.microsoft.com> wrote in message news:08ad01c3d513$e0e22dc0$a501280a@phx.gbl... > how to find the number of messages currently in my inbox? ...

OLE Server Error Message
Access 2002. I am running a database compiled with Access 2003 on a system that is using Access XP (2002). When I exit the database I get an "information" dialog that says: A problem occurred while Microsoft Access was communicating with the OLE server. Try one or more of the following: *Make sure you're connected to the network server where the OLE server application is located. *Close the OLE server and restart it outside of Microsoft Access. Then try the original operation again from within Microsoft Access. *Reinstall the OLE server to ensure that it's register...

NDR Message 5.7.1
I have a problem with message beging recieved through our exchange server. This recently started. One of our other admins did some tweaking before he went out of town and we are having a hard time finding out what was done and yes we have tried to contact him. Mail sent from exchange users come in fine but when sent from external addresses (the ones we have tested) do not come in and get a ndr message. I don't know how long this has been happening exactly but it has been a week since the other admin left. Used both DNSreports / DNSstuff and oddly both have the MX and DNS succes...

Runtime error
Hi, I've tried to combine 2 macros that I've used successfully separately. The first one protects the user interface and the second resets sheets to A2 Private Sub Workbook_Open() Dim sht As Worksheet Application.ScreenUpdating = False For Each sht In Worksheets Const TopLeft As String = "A2" sht.Protect Password:="*9reh8", _ UserInterFaceOnly:=True Application.Goto sht.Range(TopLeft), Scroll:=True Next sht Application.ScreenUpdating = True End Sub Could anyone tell me where I'm going wrong please Many th...

Message Tracking with Message ID
I work on the Defense Message System. We get error reports for messages with a message ID on them. The problem is how does one find the message that goes with the ID in a "FIND" of the Sent Items on the senders computer? I have not found a way that is user friendly to do this search on the users computer. Very Respectfully, ET3 Hettinger USN ...

Error message Importing INV File
I am using Money 2005 Samll Business and when I try to import a custom invoice I receive the following error message. Money cannot import an INV file that was created before July, 2002. Please try importing a more recent version of the file. I just created my file tonight and the properties say it was created 11/19/04 so there should be no problem with the date. I am set up for US regional settings. Has anyone ran into this and figured a way around it? Thanks, ...

Compiler error: Can't find project of library.
I am using Access 2003. I have Visual Basic For Applications as an Available Reference. When it gets to "Date" in the code I get a Compiler error: Can't find project of library. Can anyone help? Sounds like either a bad reference or a naming clash. In the code window, choose References on the Tools menu. Anything marked "MISSING"? If so, see: Solving Problems with Library References at: http://allenbrowne.com/ser-38.html If not, you have something else named Date, which is a reserved word in VBA (and also in SQL.) Find and rename it. If it is a field, y...

Suddenly no pictures in HTML messages
Running XP pro SP3, Outlook 2002. About Wed. or Thurs, any html messages received do not include pictures. Did Microsoft send out an update that might have interfered? Or did I do something I'm not aware of? Thank you, Roberta Roberta, you wrote on Sat, 4 Apr 2009 06:52:06 -0700: > About Wed. or Thurs, any html messages received do not include > pictures. Did Microsoft send out an update that might have > interfered? Or did I do something I'm not aware of? There is no such an update. Verify if the Internet Explorer is in offline mode (go to the file menu in IE)...

Copy Local Message Rule
I've created a complicated message rule for filtering that I would like to put on other client machines. Can I copy it? Is this possible? WIn2k server/ Exchange 2k w/all current SPs. STEVE ...

cannot move messages
Sometimes when I attempt to move a message from the inbox to a storage folder I receive the following error message - "An unknown error has occured. The selected message(s) could not be moved." Why am I receiving this message and how can this problem be corrected? Any suggestions would be appreciated. Thanks What kind of mail account is it? POP3, IMAP or HTTP? Both IMAP and HTTP accounts synchronize with the mail server, so moving a message from the mail account to the storage folder requires that WLM tell the mail server to delete the message from the server ma...

anchor picture to text box
(Publisher 2003) I have a newsletter with a Kudos box. In the corners of the box I have a happy face. I'd like the happy faces to be anchored to their corners so when I enlarge or shorten the box, the faces move along with the text box. Why not create a rectangle, insert the happy faces, group. The problem as I see it would be if you resize, the happy faces could be distorted if you widen or shrink the group. You would always have to re-size proportionally. -- Mary Sauer http://msauer.mvps.org/ "Helen" <Helen@discussions.microsoft.com> wrote in message news:193...