Null in text box

Can anyone see what might be wrong withthis procedure?

Private Sub Job_Number_BeforeUpdate(Cancel As Integer)

   If IsNull(Me.Job_Number) = True Then
     MsgBox "No Job Number Entered"
   Cancel = True

End If
End Sub

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

0
Haggr1
7/10/2007 8:07:01 PM
access.formscoding 7494 articles. 0 followers. Follow

2 Replies
780 Views

Similar Articles

[PageSpeed] 35

"Haggr1 via AccessMonster.com" <u35393@uwe> wrote in 
news:74fa8171f7137@uwe:

> Can anyone see what might be wrong withthis procedure?
> 
> Private Sub Job_Number_BeforeUpdate(Cancel As Integer)
> 
>    If IsNull(Me.Job_Number) = True Then
>      MsgBox "No Job Number Entered"
>    Cancel = True
> 
> End If
> End Sub
> 
Let me guess, tt always works, even if you have typed something 
into job_number?

Job_number will not get a value (the default property) until the 
update event. Specify the text property in your test.
If IsNull(Me.Job_Number.text) Then

You don't need the = True part, it's redundant: 
true = true is true



-- 
Bob Quintal

PA is y I've altered my email address.

-- 
Posted via a free Usenet account from http://www.teranews.com

0
Bob
7/10/2007 7:37:39 PM
Thanks,  I did try that and still didn't work.  Am I correct in thinking "Me.
Job_Number" is referring to the text box on the form and not the field in a
table that text box  is bound to?
Does it make a difference that the field that text is bound to is "number
date type"?
I know I could make that field required in the tables properties, but I don't
want any "Access" generated error messages.

I just what MsgBox "job number required" if a user forgets to enter a job
number.


jsrogol wrote:
>Trying leaving off the =null and it should work fine.
>
>> Can anyone see what might be wrong withthis procedure?
>> 
>[quoted text clipped - 6 lines]
>> End If
>> End Sub

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

0
Haggr1
7/10/2007 9:02:24 PM
Reply:

Similar Artilces:

The text in the inserted text box doesn't print
When I type text into the text box and then print, the added text doesn't show on the printed copy It is possible the added text doesn't fit the text box, have you tried expanding the text box? -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "SS" <SS@discussions.microsoft.com> wrote in message news:8D633F32-E54D-452E-B2F3-427E69BBF8BA@microsoft.com... > When I type text into the text box and then print, the added text doesn't > show on the printed copy ...

How do I fit A4 text into A5 in publisher?
I have an A4 document in publisher which I want to convert to A5; that was easy but the text remains the same size and runs over the margins. How can i resize the text to fit the A5 pages? Select the text box, Format, AutoFit text... -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "John" <John@discussions.microsoft.com> wrote in message news:AC06932C-D51B-4C83-80BC-DCEB4C9D0772@microsoft.com... >I have an A4 document in publisher which I want to convert to A5; that was > easy but the text remains the same size...

Null Is Null
I've got a text box in a report that's not returning properly. Here's its Control Source: =[Reports]![rptFGPackConfigsPKWeights]![srptFGPKConfigsSUPK_totalwt]! [SumWtg]+IIf(IsNull([Reports]![rptFGPackConfigsPKWeights]! [srptFGPKConfigsTPK_totalwt]![SumWtg]),Null,"") This returns #Error. It's definitely my IIf statement as it returns properly when removed however there are times when [srptFGPKConfigsTPK_totalwt].[SumWtg] will be null. In fact, this subreport will not appear if no records exist. I suspect that this is the problem. How can I write this Control Source t...

if A1=Null and B1=A1 why is result in B1=0 ??
if A1=Null and B1=A1 why is result in B1=0 ?? because of this I get wrong result for average calculations: average for (6,8,0) <> average for (6,8,null) Use =IF(A1="","",A1) -- HTH RP (remove nothere from the email address if mailing direct) "WGeorg" <WGeorg@discussions.microsoft.com> wrote in message news:09FCCF25-D0DC-4B1E-BFA1-CEF9A9327C46@microsoft.com... > if A1=Null and B1=A1 why is result in B1=0 ?? > because of this I get wrong result for average calculations: average for > (6,8,0) <> average for (6,8,null) Use this ...

Text Management
I have a SS that I want to link to another. The other spreadsheet would have simply notes that would be regularly updated. Using the hyperlink functionality would there be a better way to do this i.e. with say, Word? I'm thinking long term text managment... I guess it kinda-sorta depends on what exactly you're trying to do. Personally, I prefer to keep everything within one Excel Workbook, and put things on other Worksheets, and hiding them or not, depending on my need. You can of course hyperlink to other Excel Workbooks and/or Word files if you wish. That just requir...

Why are these numbers as text
Hi, I have just exported some data in a table from an sql file to Excel and have noticed that some of the figures in the column have a small green triangle next to it with the message, 'it is formatted as text or has an apostrophe in front of it'. What does this mean? I am trying to change a column of 0's to 1's then import it back into sql, but after replacing the 0's with 1's, find that some have this triangle. I have searched the help files but can't find anything to help me. Thanks Rock To convert "text" numbers to real numbers, put 1 in an...

CONCATENATE involving CHAR(13) and CHAR(10): "" marks when copy/paste to text editor [???]
The result of this formula: =CONCATENATE("#1=",W4,CHAR(13),CHAR(10),"GOTO665",CHAR(13),CHAR(10),"N5",Y4) has quotation marks when copy pasted into a text editor, like so: "#1=2 GOTO665 N553" You can see that the CR/LF comes out but it adds the quotation marks. Is there any cure for this? Thanx, -plh PS: I tried using only CHAR(13) in place of CHAR(13),CHAR(10) and also CHAR(10) only, and also using cell references in place of the literal strings, that is: =CONCATENATE($Y$1,W3,CHAR(13),CHAR(10),$AA$1,CHAR(13),CHAR(10),$Z $1,Y3) but the result was the sam...

Syntax for Is Not Null ?
When one of our forms is opened (Current event) I want a message box fired by certain conditions (that the Ref control does have a value, but the Country control is empty). I have tried various bits of code along the lines shown below, but keep getting runtime errors. Wot's wrong with the following, please? If [Me.Ref] is not null and [Me.Country] = "" Then MsgBox "Please enter the country!" Many thanks CW CW - Try this: If (not isnull([Me.Ref])) AND IsNull([Me.Country]) Then MsgBox "Please enter the country!" -- Daryl S ...

Comparing Two Columns of Text
I have two columns of names and would like to see which names are in both columns. I believe that they all will match exactly, if I can compare them. Any help is greatly appreciated! Thanks Heather -- sailortigger ------------------------------------------------------------------------ sailortigger's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24499 View this thread: http://www.excelforum.com/showthread.php?threadid=380955 Chip Pearson has lots of ways to work with duplicates at: http://www.cpearson.com/excel/duplicat.htm sailortigger wrote: > >...

Rich Text Format
Hi, My problem is thus, I want to supply some text and a CHARFORMAT2 struct to a method and simply have it return the RTF, you can see below. I dont want to have to create a rich edit control etc. There must already be a method or class that will do this surely? Using a rich edit control you can take a string "this is a testing string". Create a CHARFORMAT2 struct and pass it to the metthod SetCharFormat to format that string. This produces some rtf text like this - although note its not the rtf for the "this is a test string" text. What i want to know is how...

When is a Null not a Null?
I have a form which is used for adding and entering data depending on where it is called from. When called in add mode (acFormAdd) a blank form is openned. When the cursor enters the text box [Name] on the form field I am trying test whether it is empty so that a search form can be openned if a new name is to be added. (I don't want the search form to open in cases when the form already has data in and I am editing rather than adding data). The form is based on a query and the data displayed in [Name] is the result of a calculated field in the query which concatenates firstname and surn...

how to set a image to a dialog box
Hi, I need to know ,how to set a image to dialog box. That image should be bmp ,jpeg or etc. how can i do that. Please give any possible solution. -- Regards, RamakoteswaraRao Koti If you are talking about putting an image in a dialog you can use a picture control (from the toolbox) to do that. If you are talking about making a bitmap the background for a dialog here's an article Nish wrote some time back that may be interesting to you: http://www.codeproject.com/dialog/bmpdlg01.asp Tom "Ram" <koti@nannacomputers.com> wrote in message news:uXxzz8nQGHA...

Text conditions
I am writing 2 user guides, one for operators and one for supervisors. Some content is the same, how can I create condition to publish the different contents? -- B. L. ...

Centreing Text In Excel Cells
I am send data to an Excel Spreadsheet, which includes some numeric data and some text data. I want to have the text in all columns in the centre of the cell. I have tried lots of different code:- xlSheet.Range("A:L").HorizontalAlignment = HorizontalAlignment.Center xlSheet.Cells.HorizontalAlignment = HorizontalAlignment.Center xlSheet.Columns.HorizontalAlignment = HorizontalAlignment.Center xlSheet.Cells(10, 1).HorizontalAlignment = HorizontalAlignment.Left xlSheet.Columns("C").HorizontalAlignment = HorizontalAlignment.Center xlSheet.Range("A6:L15"...

What is the Null character?
What is the character sequence that Excel uses to represent an empty cell? I am using a formula and when it returns false, I would like for it to represent the cell as if it was empty. I have tried using "" as an empty cell, but excel recognizes that this is a value, not an empty cell. You can't do what you want to do. A formula always returns *something*. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Quinn Ramsey" <Quinn Ramsey@discussions.microsoft.com> wrote in message news:D67F6311-0CCA-48B5-A...

Combo Box...
How do I add rows to a combo box? I need to add a simple drop down box that contains simple data, but I need the formatting (border, scroll...) to remain in view. Is a combo box what I'm looking for? View>Toolbars>Control Toolbox. Click on the "design mode" button. Click on the "combobox" button. Draw a combox box on the sheet. Right-click on the combobox and "Properties" Edit the ListFillRange to the range of items you have listed on a sheet, say A1:A23 Pick a "linked cell" to link your selection to. Set the ListRows to the number ...

text is being interpreted as a date
I have the following value which I split into 4 columns using Text T Columns (within a vba routine) : 02-9508~8203.20.6060~646~5. (delimited on the ~ ) the problem is that the first column of data gets automatically (an incorrectly) recognized as a date (Feb-08). If I format it afterwards, it turns it into 2778797. That value is supposed to be text (02-9508). does anyone know how I can keep excel from incorrectly misinterprettin the format of the data ??? :confused -- Message posted from http://www.ExcelForum.com format your columns as "Text" before you do your text to co...

converting text to numbers
I would like to convert text to numbers. I have a filed 123 that is text and I would like to convert it into numbers. /Tinnen Hi Tinnen Copy a empty cell Select your range and right click on it Choose pastespecial.. And select Add Ok -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Tinnen" <magnus_annchatrine@hotmail.com> wrote in message news:19a401c38289$6c46de20$a101280a@phx.gbl... > I would like to convert text to numbers. > > I have a filed 123 that is text and I would like to > convert it into numbers. > > /Tinnen ...

Managing Mail Boxes
When viewing the mailboxs on my system using the system manager I noticed that the system mailbox has a large number of items. How can I get in to clear these items? Also the system attendant shows that my own mailbox contains a large number of items but all of my items have been downloaded to outlook (SMTP). How can I view/clean-up these items as well. Hiya, you need to archive these items on your own machine in outlook. (File>Archive). This way the mail is stored on your own computer rather than on the Exchange server. Gareth. "Lee" <Lee@discussions.microsoft.com>...

e-mail hung in out box
e-mail address gets modified by @#$%computer to include apostrophes at start and end of address. Manually deleting and replacing with the proper address and then hitting send and then send/receive causes the @#$%computer to again insert the @#$%apostrophes which stops the send function. At first, it seemed only random that the apostophes were added. Now I can't get a msg. sent..Any clues? ...

Charting null values
I have a chart that is plotting null values. I tried the formula =if(C25="",N/A(),Sum(C22:C25)). I've also deleted the formula to create a completely null cell. I've been to Tools, Options, Chart and selected Plot empty cells as Not plotted, zero and Interpollated As well as turning Plot Visible Cells only (turned it on and off) Nothing seems to make a difference. Any suggestions? Stephanie, what kind of chart are you using? Can you give an example of how your data table looks like? br, Henk "StephanieH" wrote: > I have a chart that is plotting ...

print selected text OL2003
hey folks been beating my head on wall for a few days now any one knows a way to set printing options/styles to print selected text in a message ? this is for MS Outlook 2003. thanks no, it's an all or nothing deal. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscribe to Exchange Messaging Outlook newsletter: ...

Invisible or "missing" Outlook message text on reply or forward using Word as editor
We seem to have one Outlook 2003 SP2 user that seems to automatically delete or truncate parts of the message text when replying or forwarding. There may be a long thread of email replies but only the part of the most recent post is displayed. When you do a Select All/Ctr A to highlight the email, then paste it in notepad, all of the thread is displayed. When we deselect Word as the email editor, the problem thus goes away. Word seems to hide or make invisible the text. I just saw a similar post here from a while ago where the reply text was missing. But in my case just the history is &qu...

Convert dates stored as text
I have Excel 2007 in English, but I sometimes receive data that comes from another applicationes, so dates are stored as text because they come in following format: dd/mm/yyyy. And I have the format mm/dd/yyyy. So, in the same column, I have dates stored as dates, and dates stored as text. Which is the easiest way to convert them all to date format? Thanks in advance. Regards, Emece.- Be careful. I'd bet that those values that come in as real dates aren't what the original data represent. For instance, if you have two values: 25/12/2010 and 01/02/2010 The...

Border with text
I'm trying to make a border using text. I want to repeat the same phrase over and over again. Idealy, I'd like the words to make a rectangular border for a sign... and when it hit the corner of the page, the phrase would continue down the next angle, and so on, until it made a box. Does anyone have any ideas on how to do this? WordArt would be your only option. If you had a draw program... Serif has a free draw application. http://www.freeserifsoftware.com/ OpenOffice is free and has a draw feature. www.openoffice.org I have a method using WordArt on my web site that might be...