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 7493 articles. 0 followers. Follow

2 Replies
1756 Views

Similar Articles

[PageSpeed] 10

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

Comment box name
I'm using Excel 2003 and use comment boxes extensively. Each time I open/iinsert a new comment box, a name appears that is not mine. How can I change this to have my name appear each time I open/insert a new comment box? Tools>Options>General>User Name. Enter your name in the dialog box. Gord Dibben Excel MVP On Wed, 2 Mar 2005 07:57:04 -0800, hruzam <hruzam@discussions.microsoft.com> wrote: >I'm using Excel 2003 and use comment boxes extensively. Each time I >open/iinsert a new comment box, a name appears that is not mine. How can I >change this to ha...

Unbound Text Field
I need to set he value of an Unbound Text field on a report. Since this report is called from several different forms I can't set it on the report itself and it doesn't work setting it from the from. Any suggestions appreciated! Thanks DS Which version of ACCESS are you using? What is the actual value that needs to be set in the textbox -- is it a fixed value, or a value from a form's textbox, or what? -- Ken Snell <MS ACCESS MVP> "DS" <bootybox@optonline.net> wrote in message news:e1wPh.416$Hg1.311@newsfe12.lga... >I need to set he ...

How do you get the sum of 2 different text values?
For instance, I need to add the amount of times "S" and "HS" appear in a row. I figured out that the COUNTIF function will add the amount of times "S" appears in a row, but I can't figure out how to make it add both and give me a number value as the answer. Is this even possible? Try this: =COUNTIF(A:A,"S")+COUNTIF(A:A,"HS") Regards, Paul "sunshine.girl" <sunshine.girl@discussions.microsoft.com> wrote in message news:4C63C684-D389-4BA0-A73F-8AC553B7F7D3@microsoft.com... > For instance, I need to add the amount o...

update check box fields in the table using array based on certain value
One of my table has _Ct values and I want to update other relevant fields in the same table ( basically check box) with ‘yes’ or ‘no’ depending on the _ct values. Can some one show me how I can do this in Access and correct the following logic? Public Const ct = "H1_Ct H3_Ct H5a_Ct H5b_Ct RP_Ct swInfA_Ct swH1_Ct" Public Const test = "H1_Tested H3_Tested H5a_Tested H5b_Tested RP_Tested” Public Const result = "H1_Result H3_Result H5a_Result H5b_Result RP_Result" Dim objDB As DAO.Database Dim mytbl As DAO.Recordset Set objDB = CurrentDb() Set myt...

Lookup Box on an Unbound Form
Is it possible to add a combo lookup box to an unbound form? If so, how? Open in design view, click on the Combo icon on the ribbon and place cursor where you want the corner to be and drag to the opposite corner. Right click it and scroll down to select Properties. Add a source. By the way what do you expect it to do? -- Build a little, test a little. "gagecres" wrote: > Is it possible to add a combo lookup box to an unbound form? If so, how? ...

How to change menu text font for MDI app?
I have a MDI app written in MFC. I need to change font for main frame, menu text, status text, and child frame. What is the best way to enumerate through all those controls/frame windows to change font? Thanks. Michael I would have them each change their own fonts in response to a broadcasted message. http://www.codeproject.com/docview/Broadcaster.asp I am assuming that this happens after all the objects have already been created (or else you would have been doing this in the initialization code of each class), so if is because of a user setting, I would save the setting, then broadc...

selected text highlighting issue
Windows XP SP3. Office 2003 fully updated. This has always bugged me so I figured I'd finally ask the question. I run 2 monitors and work on multiple things at once. If I have a Word doc open (or notepad or some other editor) and select a block of text and then move to another application, the text in the Word doc no longer appears selected. This is extremely annoying at times. Just because my Word doc is no longer the active application doesn't mean that I don't want to see what I've selected. And if it's so that I know it's not the active application, well t...

Linking a combo box
Hello. I'm looking for help with creating a combo box that will link to othe worksheets. Basically, what I am doing is making an information page for multipl car companies. So what I'm looking at doing is having a combo box/dro down list that if I choose, for example, "Ford", it will link to worksheet with information about Ford, and if I choose "Toyota", i will link to a separate worksheet with information about Toyota. Is it possible to do this? :confused: Any help is greatly appreciated -- jimme --------------------------------------------------------...

find a date on sheet 2 and count text in that column
I'm lookung for the formula to use that if I was under one date on one page, to look what date im under go to the 2nd page, find that date then count the text specified under that date. My pages are set up as follows: sheet 1 A B C D E 1| 1-oct 2-oct 3-oct 4-oct 2| john text 1 text 1 text 2 text 1 3| jack text 1 text 2 text 1 text ...

Is there a Date Time Conversion from text?
I have DateTime stored as text in an Access db field. Ex: 1/22/2008 10:34:29 AM I want to convert this data form text to a real DateTime value all inclusive. I am able to pull the date DateValue and time TimeValue, but is there a way to get them both together. Thanks Try using CDate or DateAdd DateAdd("D",0,[Your Text Date Time]) CDate([Your text date time]) If your string field could be null, or a zero-length string, or invalid, then I suggest you test it first IIF(IsDate([Your Text Date Time]),CDate([Your Text Date Time]),Null) -- John Spencer Access MVP 2002-2005, 2...

text flow
Is there a way to have text flow around the outline of a graphic so the text takes the form of the image? A small child turns to Ed, and exclaims: "Look! Look! A post from Brian Lubroth <blubroth@communityschool.us>!"... > Is there a way to have text flow around the outline of a > graphic so the text takes the form of the image? Use the "Tight" wrapping option? -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading this message, view the disclaimer: http://mvps.org/the_nerd/disclaim.htm I'm not really looking to wrap the...

Short Memo in text box
I want to print a box in top left corner of page that has text in it and rotate it approx 45 degrees ... it will then serve as a memo on sheets I will over print it on. Yes, it can be done. What part of this do you need help with? -- JoAnn Paules MVP Microsoft [Publisher] "mercedes300" <mercedes300@discussions.microsoft.com> wrote in message news:60EA9C52-D36A-4635-A115-A15FE9C4F21B@microsoft.com... >I want to print a box in top left corner of page that has text in it and > rotate it approx 45 degrees ... it will then serve as a memo on sheets I > will >...

why are there quotes in my exported text file?
I saved an Excle file containing text into a tab delimeted text file and all the data is now in quotes. The file will be used as a input file to another progarm and the quotes will not be accepted. How can the quotes be left off? AlexK wrote: > I saved an Excle file containing text into a tab delimeted text file and all > the data is now in quotes. The file will be used as a input file to another > progarm and the quotes will not be accepted. How can the quotes be left off? Find and Replace. Find " and replace with - nothing! -- Interim Systems and Management Accounti...

Making a combo box enable for two case
i Have a combo box name Cbmonth when click a specific case i.e. month sales the box enables, Me.cbMonth.Enabled = (SalesPeriod = byMonth) what i need is when we i select Sales person case i need the cbmonth to enable i've tried this me.cbmonth.enabled= (SalesPeriod = byMonth and BySalesPerson) but it doesn't work Any ideas anyone ??? Write it like this: me.cbmonth.enabled= (Me.SalesPeriod = "byMonth" Or Me.SalesPeriod = "BySalesPerson") Note: I am assuming that SalesPeriod is a bound control on your form and that it has text data...

Checking if txtbox is null and DCount parameter
Greetings, I have the following code assigned to previous record navigation button (See below) :- How do I use the Is not null ?? Testing the code the Me.txtAwardId is populated but during the DCount execution I get the error "The expression you entered as a query parameter produced the error: 'StrAward' Can anyone assist? Thanks VBA code attached to button. DoCmd.RunCommand acCmdRecordsGoToPrevious Dim SAwards As Integer Dim StrAward As String 'IsNotNull (Forms![frmCreateAward]!txtAwardId StrAward = Me.txtAwardId SAwards = DCount("[StudentID]", &q...

Text Box Calculation Formula
SpreadCred InsideSpread LeftMain RightMain I have a text box (SpreadCred) that needs to be calculated/populated by a combination of factors. 1. SpreadCred should populate off of the text box - InsideSpread. 2. The value in SpreadCred can not be greater than text box - RightMain nor text box - LeftMain. If it is bigger than either number, it will max out at the larger of the two. Thanks for your time. How this is done depends a little on whether the value will respond to user input or to previously-entered data. This could be done with a nested IIf, but is really a ...

format excel to text
how do i get excel file format to be csv file formatted with the delimiter "|" as a separator? See one answer in .newusers. Please don't post the same message to multiple groups. It tends to fragment your answers, and potentially wastes the time of those who answer a post that's already been answered. See http://cpearson.com/excel/newposte.htm for tips on using these groups effectively. In article <B3361666-9950-4CB3-B0A6-04EFE999263F@microsoft.com>, "azlan" <azlan@discussions.microsoft.com> wrote: > how do i get excel file format to be ...

ALT + Enter and Wrap Text #2
Thanks for the advice, even if it wasn't necessarily what I wanted t hear ;-) I can work around this limitation and still avoid the dreaded Merg Cells (always the optimist here...). Cheers -- Christophe ----------------------------------------------------------------------- Christopher's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1604 View this thread: http://www.excelforum.com/showthread.php?threadid=27499 An ugly possibility--use a function: ="item 1" & char(10) & "item 2" & char(10) & "item 3" A not s...

text search for a non-constant value?
Hi! The seach/3 function searches for 'find_text' in 'within_text', starting at the 'start_nun's character: SEARCH(find_text,within_text,start_num) I need to find the first digit in a string. I guess, search/3 does neither support regular expresseions, no does it allow a function instead of a constant 'search_text'. One way to find the first digit is this monster: =MIN( IF(ISNUMBER(SEARCH(0;D2));SEARCH(0;D2);9999); IF(ISNUMBER(SEARCH(1;D2));SEARCH(1;D2);9999); IF(ISNUMBER(SEARCH(2;D2));SEARCH(2;D2);9999); IF(ISNUMBER(SEARCH(3;D2));SEARCH(3;D2);9...

Deleting text files after use
I am opening up a text file and reading its contents. Once I am done processing the file I would like to remove it so the code knows not to repeat the process the next time that window is open. I can't seem to find a "TextFile_Delete" anywhere. Am I missing it somewhere? Thanks, Don Nevermind - I wrote this too soon. I found File_Delete. Sorry for the inconvenience... Don "rengeek33" wrote: > I am opening up a text file and reading its contents. Once I am done > processing the file I would like to remove it so the code knows not to repeat > the ...

IF or SUMIF to bring back text?
I am trying to match departments which have two different titles. For example, there are 50 departments that are futher classified into 150 sub-departments. I do have the data showing departments and their corresponding sub-departments in two columns. On another sheet there are only sub-departments and I need to assign the corresponding department name. I have tried IF and SumIf but neither works. Basically, I need a formula to match the text and bring back the text for the sub-department. Thank you. sounds like you need VLOOKUP "Valerie" wrote: > I am...

Database text converted to numeric
I Imported data from a SQL Database, it is numeric and alpha numeric but mostly numeric numbers (Serial numbers). I need to compare this list to another Excel list containing the same information but with some numbers missing. I pull this into Access and when I try and compare them the error is that the format has to be the same. I changed the format of the list I imported to Numeric (most of the numbers is only numbers) but now I have to press F2 and enter on every single number (database is only 227500 lines) to convert it to a Number. I thought it was because it still saw itself as a Dat...

What is the fastest possible xsl style sheet to add another <box> node under <boxes> ?
What is the fastest possible xsl style sheet to add another <box> node under <boxes> ? <foo> <car></car> <boxes> <box id="234" /> <box id="75" /> </boxes> </foo> here is what i want it to look like after the xsl adds another box node: <foo> <car></car> <boxes> <box id="89"> <bar id="1" /> <bar id="35" /> </box> <box id="234" /> <box id="75" /> </boxes> </foo> notice ...

Putting database data into a combo box...
Hi guys, I have a working databse query thar returns a list of names. I want to put this into a combo box. Currently I am inserting the database data into a range on my spreadsheet (A1) and it uses as many rows as there are names. In my combo box properties I can specify the ListFillRange as A1:A5 or whatever and this works okay, but the thing is, as names are added to the database, I want the range A1:A5 to update dynamically. Q1. Can I send the QueryTable data directly to the combo box ListFillRange... With ActiveSheet.QueryTables.Add(Connection:=connstring, Destination:=ComboBox1.Lis...

My "Insert" button is not allowing me to type over text. Help??
Is there somewhere I can go to turn this on or off ?? Thx. Click the Insert/Overtype button on the Word 2007 status bar or Word Options > Advanced > Editing Options > Use the Insert key to control overtype mode. -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> "jozee...