Print message on screen using VB

Hi,

I'd like to print a message, like 'Data Error" on screen using VB when the
user enter the wrong data, e.g:  

If wrongdata then
   Print "Data Error"
end if
 

Is anybody can tell me how to write in VB? I tried to use 'Print' statement,
but it doesn't work.

Thank you in advance.

KFT

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

0
KimTong
9/25/2007 1:18:42 PM
access.formscoding 7493 articles. 0 followers. Follow

4 Replies
2694 Views

Similar Articles

[PageSpeed] 4

Thank you Klatuu, it works. And how can I move the cursor move back the same
field?. Because after the error message comes up the cursor move to the next
field.

KFT

Klatuu wrote:
>Typically, you use a Message Box to display messages like this.
>    If wrongdata then
>        MsgBox "Data Error"
>    end if
>
>You can also put messages in a Label Control if you don't want a message box 
>to pop up.
>
>    If wrongdata then
>        Me.lblMessage = "Data Error"
>    End If
>
>> Hi,
>> 
>[quoted text clipped - 12 lines]
>> 
>> KFT

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

0
KimTong
9/25/2007 1:58:24 PM
If you are validating entry in a control, then you use the control's Before 
Update event.  The Before Update can be Canceled.  If the validation fails, 
canceling the event prevents the update from occurring and leaves the cursor 
in the control:

Private Sub MyControl_BeforeUpdate(Cancel As Integer)

    If wrongdata Then
        Cancel = True
        MsgBox "Data Error"
    End If

End Sub
-- 
Dave Hargis, Microsoft Access MVP


"KimTong via AccessMonster.com" wrote:

> Thank you Klatuu, it works. And how can I move the cursor move back the same
> field?. Because after the error message comes up the cursor move to the next
> field.
> 
> KFT
> 
> Klatuu wrote:
> >Typically, you use a Message Box to display messages like this.
> >    If wrongdata then
> >        MsgBox "Data Error"
> >    end if
> >
> >You can also put messages in a Label Control if you don't want a message box 
> >to pop up.
> >
> >    If wrongdata then
> >        Me.lblMessage = "Data Error"
> >    End If
> >
> >> Hi,
> >> 
> >[quoted text clipped - 12 lines]
> >> 
> >> KFT
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200709/1
> 
> 
0
Utf
9/25/2007 2:10:03 PM
Hi,

I did try before using control After Update, something like this:

If wrongdata Then
       MsgBox "Data Error"
       Me.fieldname.???  ---> go back to the same field.
 End If

But I forgot how to write it. If you have any other any idea, I am
appreciated.

KF

Klatuu wrote:
>If you are validating entry in a control, then you use the control's Before 
>Update event.  The Before Update can be Canceled.  If the validation fails, 
>canceling the event prevents the update from occurring and leaves the cursor 
>in the control:
>
>Private Sub MyControl_BeforeUpdate(Cancel As Integer)
>
>    If wrongdata Then
>        Cancel = True
>        MsgBox "Data Error"
>    End If
>
>End Sub
>> Thank you Klatuu, it works. And how can I move the cursor move back the same
>> field?. Because after the error message comes up the cursor move to the next
>[quoted text clipped - 19 lines]
>> >> 
>> >> KFT

-- 
Message posted via http://www.accessmonster.com

0
KimTong
9/25/2007 2:55:38 PM
Yes, it works. Than you very much...

KFT

Klatuu wrote:
>If you are validating entry in a control, then you use the control's Before 
>Update event.  The Before Update can be Canceled.  If the validation fails, 
>canceling the event prevents the update from occurring and leaves the cursor 
>in the control:
>
>Private Sub MyControl_BeforeUpdate(Cancel As Integer)
>
>    If wrongdata Then
>        Cancel = True
>        MsgBox "Data Error"
>    End If
>
>End Sub
>> Thank you Klatuu, it works. And how can I move the cursor move back the same
>> field?. Because after the error message comes up the cursor move to the next
>[quoted text clipped - 19 lines]
>> >> 
>> >> KFT

-- 
Message posted via http://www.accessmonster.com

0
KimTong
9/25/2007 4:12:14 PM
Reply:

Similar Artilces:

using MSN Bill Pay for checks WITHIN Money 2007
I just updated to 2007 since I heard they fixed the integration with MSN Bill Pay (which I use to pay my bills). Previously I had to use the MSN Bill Pay Interface to pay bills. What I want to do is stay inside Money when paying a bill or writing an electronic check. Ideally, I would enter it directly into the register and then hit a "Send Electronic Check with MSN Bill Pay" option, or at least enter it into the Bills window and have it pay with MSN Bill Pay, but this option doesn't seem to exist. In the Bills interface, the only option I get is to "Write Check"...

Someone's using my domain name to send e-mails
I came into work this morning and I received an e-mail from myself. An e-mail I never sent. From: Annsmith@mydomain.com To: Annsmith@mydomain.com How is this possible?. The message was for weight loss pills. I look after the computers in the office so I have to find an answer for this problem. Also, last week, an employee received and e-mail from someone using our domain name. jim@mydomain.com. Right away I knew it was fake because we don't use that kind of naming convention here at the office and I'm the only one who sets up the e-mail addresses. We use Outlook 2000 and excha...

Can't use my password in 2005
I know 2005 seems to have a lot of issues, but I can't find any answers for my problem. I installed Money 2005 from 2003. Now it tells me that my password or e-mail is incorrect, and I can't open my file I was running in 2003. I had no problems in 2003. I've done everything I can think of that seemed at all relevant from this newsgroup and microsoft support. Other relevant info: -I have the most updated version (14.0.120.1105) -I can't open my file or the backups (same error for all) -I used my passport for 2003, and I can still log into passport web site...

Messaging
Anyone, I have a CDialog with some controls. Some of those controle have an OnKillFocus. If I use the following code I can do somethin if the tab-key is pressed. BOOL CDIALOG::PreTranslateMessage(MSG* pMsg) { if( pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_TAB ) { do something... } } I want to know if the OnKillFocus of my controls is activated by using the tab-key or by doing something else, for example press in another control with the mouse. Thank you for your reaction. Hi, OnKillFocus () is called for all controls that are about to lose the inp...

Outlook Express message
I am getting the following message on some of my Outlook message. Even if I send myself one picture from my office and I feel it's safe. OE removed access to the following unsafe attachments in your mail: In these cases, I cannot open the e-mail. Can anyone explain??? Maureen 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 the...

use the current time to return a value
Simple formula? if the time is >=07:00:00<15:00:00, G$1. = 1 if time >=15:00:00 < 23:00:00 G$1 = 2 if Time >=23:00:00 < 07:00:00 G$1 = 3 I have tried to do this a few different ways and have been unsuccessful. Could someone help please? One way: G1: =IF(OR(MOD(NOW(),1)<7/24,MOD(NOW(),1)>=23/24), 3, IF(MOD(NOW(),1)>=15/24, 2, 1)) In article <1133191901.819183.53950@g14g2000cwa.googlegroups.com>, sjd371@netzero.com wrote: > Simple formula? if the time is >=07:00:00<15:00:00, G$1. = 1 if time > >=15:00:00 < 23:00:00 G$1 = 2 if Time...

Print multiple labels for each order line
I am trying to design a label report in Crystal which runs off a sales order. The label report prints the item number. I need the report to print as many labels as the quantity on the sales line so if there are 2 lines on the sales order for quantity 10 and 15, then I want 10 copies of labels for the first item and 15 for the next. How can I build this into my crystal report. I was unable to get the same process of printing labels in an efficient manner; so I came up with another idea of getting it done. Let me know if you are interested to explore my idea. "Jack" wrote: &g...

changing tcp port used by exchange 5.5?
Hello, We are trying to find out if it is possible to change the tcp port that exchange 5.5 uses to send outgoing (internet bound) emails? specifically, we are trying to have our internal exchange 5.5 server send all outbound emails to our unix based/postfix server using a port other then 25. I have search both technet and google but seem to only find articles relating to inbound or client based issues. can you point me in the right direction/tech article? I have to admit I don't know if this applies to 5.5, but maybe it'll help if it's somewhat similar. This is how it'...

Original header in reply message corrupt
When replying to specific messages in the inbox, the message header for the original message, which is included in the reply, is damaged. Instead of showing the standard message header with the from, to, subject, time received, etc. fields, the message will have something like the following ????????????????>???????????????????????? >????????????????????????????>???????????????Hi Mark The new message header for the reply message will have the correct field entries (To/from address, original subject line with RE: appended, etc.) Opening the original message, or viewing in t...

can't reply or forward messages
I use Outlook Web Access Version 5.5 SP4 for our companies internet email. I can view all of my emails just fine. However, when I try to reply, reply all, or forward any email, I hear a "clicking" noise, the window closes, and nothing happens. I believe that this started after I installed Windows XP SP two ...

not printing tabloid correctly
Publisher XP lexmark optra 1200 PS drivers open a new publisher file, change the layout to tabloid, it appears correctly in design view as tabloid. However, when you go to print preview, it cuts to letter (cutting off everything that doesnt fit - it doesnt do multiple pages)..if printed, it just prints to letter - not multiple - justone cutoff job. If I make a new document in WORD XP - it prints on tabloid fine. The publisher setting for the lexmark are all changed to tabloid, 11x17 etc. Just publisher drops it to letter during the print. any ideas? thanks A small child turns to Ed, an...

is anyone using microsoft for order taking in a direct mail catal.
I am trying to see if anyone if using crm as a pure order taking function with a direct mail catalog/online catalog environment. In particuliar, has anyone modified Microsoft CRM to handle credit card processing via call center agents, links back to their online store etc. We have extensive customizations in place to accomplish this functionality. We use a combination of Great Plains, eConnect, the out-of-the box Integration, and our own credit card processing product to facilitate order entry in real time. This is highly customized to our operation but we do sell development kits for our...

Cannot Receive Messages
Hello all helping hands. I am using Microsoft outlook as an email client, and access the ISP mail server from a remote location through Dialup Access. My problem is that I can send mails all right, but cannot receive any messages. The ISP has confirmed that I have some messages in the server, but I can't download it to my computer. When pressing the send/receive, it does the job and then says task completes, but still I cannot get any messages in the inbox. If the pop3 settings has been incorrect, it would have given an error message. Is this something to do with Outlook itse...

Error Message in Outlook #8
Hi I have a user that is experiencing issues with his outlook. on opening his outlook he gets: 'The data file Personal Folders' was not closed properly' the file is being checked for problems' It takes approx 10- 15 mins to do the check every day He does check that outlook has closed down properly every evening (task manager) and it does he is using Windows 2000 SP4 With Office XP Small Business any idea's ? thanks Ria What anti-virus software are you using? What version of Outlook are you using? Does he have any add-ins installed in Outlook? -- -Ben- Ben M. S...

BOM print in graphics mode missing data
We are using GP 8 SP 2. When we print a BOM in text mode, everything prints fine but it graphics mode, each page is missing several lines of data as if it expects the page to be longer than 11". Does anyone know of a fix for this? Thanks. ...

message submitted to categorizer EXC2K
Hello, We're trying to migrate EX2K To EX2K3. For this purpose we've installed w2k3 server on a new server then installed EX2K3. We have configured both exchanges. Now the problem is that a user that has his mailbox on EX2K3 can send external and internal mails to all users (that have their mailboxes on EX2K or EX2K3) But a user that has his mailbox on EX2K can't send mail to a EX2K3 user. In the tracking log we see that the messages stuck at "message submitted to categorizer" and there is no NDR? What can we do? Thank you Erman Ulusoy It was a smtp virtual server acce...

When message changes from text to HTML format, font is not the default
Hi, Environment: My outlook 2003 default format is HTML. The Default fond for new/reply messages is Arial. The Problem: I get a message in text format. When I manually change the format of this message to HTML, the font of the message is Times Roman. How can I make outlook automatically use the default font (Arial) as the font for messages changed from text to HTML ? Thanks, Ron. -- ronbarak ...

Can't see inbox mail messages
Have been working with Outlook on this laptop and was working. Started it up recently and when I go to the Inbox, it indicated I have (8) messages in the shortcut bar but where the messages are listed, there are no messages. I looked for an alternate Inbox but do not see one. Any ideas as to what is happening? Appreciate the help Alden Do you have any views set on the in-box, such as unread messages or have you sorted by Icon? >-----Original Message----- >Have been working with Outlook on this laptop and was >working. Started it up recently and when I go to the >In...

How do I center 4 postcards on a page and centered when printed?
I'm trying to print postcards on an office printer, but the postcards are not centered within the postcard area. Some are off to the upper right, while some are off to the lower left. It just depends where the postcards are at on the sheet. I'm printing on postcard paper that has 4 postcards per sheet or paper and then you just tear them apart to separate them. I just would like the material printed on each postcard to be centered when they are printedd. Are the postcards all alike? If they are all alike setup your page as postcards from File, Page setup. If you are using 2...

characters not printing
When I print up a spreadsheet that has a lot of text in the cell, The end character of each line in a cell of text is clipped off. This even happens in cells with less than 80 chracters. Adventus wrote: > When I print up a spreadsheet that has a lot of text in the cell, The end > character of each line in a cell of text is clipped off. This even happens in > cells with less than 80 chracters. And your question is? ...

Using Macros in custom touch-screen keyboard
I have a macro saved in the Alt-F1 spot. We use the custom touch screen keyboard. I see that I have all the macros available (it lists Macro 1 - macro 24) but I can not figure out how to get the macro that I have saved to show up on my custom touchscreen keyboard. If I use the regular touch screen keyboard I can see where it has saved my macro, but if I switch to the custom touch screen keyboard I loose it. Is there any way to link the macro that we have to one of the macros (1-24) listed on the custom touch-screen keyboard? Thanks! ...

Using one column to trigger an other
I know very little about spread sheets as you will soon learn. I am making a spread sheet to sort a grocery list for two different stores by aisle and department. The items to be sorted are in column A, the quantity to purchase in column B, the aisle #s in column C for one store and D for the other. I want to be able to impute in Column B and only sort the imputed cells row in Column C and D. This will produce a printable list of only the item want in a sorted list for either store. I have the spread sheet and can sort each column but when I sort it I also get the un-marked rows of colum...

Message Mapping Question
Hi, I have Component One flexgrid control on one MFC app. I derived a class called MyGrid from the CVSFlexgrid ( wrapper class generated by vc++.net IDE ) to deal with some custom functions which are common to all the grids in the app. Now I want to intercept the right mouse button up event in the MYGrid class, do some processing and pass it on, so that if a event handler for this event is present in the dialog contanining the control some further processing is done else not. Something like ON_CONTROL_REFLECT. I implemented ON_CONTROL_REFLECT for windows common controls like combo boxe...

Duplicate KeyID in message Tracking
In Exchange, Message Tracking erase <server>.log messages but store in WMI the KeyId for each message I don't know where. So, Now I have BIG problems with WMI and Message Tracking doesn't work becouse there are duplicate KeyID with new messages and very very old messages (those messages ARE NOT in the .log, but there are remaining keys in WMI that Exchange doesn't purge). When WMI calls MessageTrackingEntry (Tracking Center by ex.) selec * from Exchange_MessageTrackingEntry FAILS with DUPLICATE KEY ERROR!!! The error in the "Tracking Center" is: (in spanish): -...

Can get new messages in center of screen?
Version: 2004 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: pop I'm on new imac 27&quot; <br> Boy, open new mail message and it shoots over to the left side of the monitor. Wasn't so bad with 20 CTR. <br> Anyway to get them to be centered? thanks! > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3343028456_1486606 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: 8bit On 12/6/09 9:19 PM, in...