Unbound Text Box Help

I have an unbound text box called TYPE, that I want to display the name of a
transaction type. See below code. I have added this to the BeforeUpdate and
the AfterUpdate and the TYPE remains blank.

This is DSform and the infromation is for display purposes only.

Does anyone have any suggestions on why this is not working and what I can do
to correct my ways.

Matt

Private Sub TYPE_BeforeUpdate()
 
    If Me.TRANS_TYP = "S" Then
        Me.TYPE = "SALES FORECAST"
    End If
    
    If Me.TRANS_TYP = "I" Then
        Me.TYPE = "INVOICE"
    End If
    
    If Me.TRANS_TYP = "M" Then
        Me.TYPE = "FIRM PLANNED MFG ORDER"
    End If
    
    If Me.TRANS_TYP = "F" Then
        Me.TYPE = "WORK ORDER"
    End If

    If Me.TRANS_TYP = "R" Then
        Me.TYPE = "FIRM PLANNED PO"
    End If
    
    If Me.TRANS_TYP = "P" Then
        Me.TYPE = "PURCHASE ORDER (RELEASED)"
    End If

End Sub

-- 
Matt Campbell
mattc (at) saunatec [dot] com

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

0
mattc66
1/28/2008 11:35:39 PM
access.forms 6864 articles. 2 followers. Follow

8 Replies
633 Views

Similar Articles

[PageSpeed] 46

Try putting your code in the Current event of the form.  BTW, "TYPE" is a
reserved word.
http://www.allenbrowne.com/AppIssueBadWord.html

mattc66 wrote:
>I have an unbound text box called TYPE, that I want to display the name of a
>transaction type. See below code. I have added this to the BeforeUpdate and
>the AfterUpdate and the TYPE remains blank.
>
>This is DSform and the infromation is for display purposes only.
>
>Does anyone have any suggestions on why this is not working and what I can do
>to correct my ways.
>
>Matt
>
>Private Sub TYPE_BeforeUpdate()
> 
>    If Me.TRANS_TYP = "S" Then
>        Me.TYPE = "SALES FORECAST"
>    End If
>    
>    If Me.TRANS_TYP = "I" Then
>        Me.TYPE = "INVOICE"
>    End If
>    
>    If Me.TRANS_TYP = "M" Then
>        Me.TYPE = "FIRM PLANNED MFG ORDER"
>    End If
>    
>    If Me.TRANS_TYP = "F" Then
>        Me.TYPE = "WORK ORDER"
>    End If
>
>    If Me.TRANS_TYP = "R" Then
>        Me.TYPE = "FIRM PLANNED PO"
>    End If
>    
>    If Me.TRANS_TYP = "P" Then
>        Me.TYPE = "PURCHASE ORDER (RELEASED)"
>    End If
>
>End Sub
>

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

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

0
ruralguy
1/28/2008 11:51:19 PM
I tried the Current Event first and this is what happens. It grabs the first
Trans_TYP and duplicates that for all records. I went ahead and changed the
name of TYPE to nTYPE.

TRANS_TYP	nTYPE	ITEM	DATE_DUE1
P	PURCHASE ORDER - RELEASED	1201-205	01/24/2008
P	PURCHASE ORDER - RELEASED	2100-533	02/19/2008
I	PURCHASE ORDER - RELEASED	2136-104	01/09/2008
I	PURCHASE ORDER - RELEASED	2136-104	01/09/2008
I	PURCHASE ORDER - RELEASED	2136-104	01/15/2008
I	PURCHASE ORDER - RELEASED	2136-104	01/17/2008
P	PURCHASE ORDER - RELEASED	2136-104	04/11/2008

ruralguy wrote:
>Try putting your code in the Current event of the form.  BTW, "TYPE" is a
>reserved word.
>http://www.allenbrowne.com/AppIssueBadWord.html
>
>>I have an unbound text box called TYPE, that I want to display the name of a
>>transaction type. See below code. I have added this to the BeforeUpdate and
>[quoted text clipped - 34 lines]
>>
>>End Sub
>

-- 
Matt Campbell
mattc (at) saunatec [dot] com

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

0
mattc66
1/29/2008 12:04:20 AM
It sounds like you need to make your code a Public Function() in a standard
module and call it from the query for the DataSheet.

mattc66 wrote:
>I tried the Current Event first and this is what happens. It grabs the first
>Trans_TYP and duplicates that for all records. I went ahead and changed the
>name of TYPE to nTYPE.
>
>TRANS_TYP	nTYPE	ITEM	DATE_DUE1
>P	PURCHASE ORDER - RELEASED	1201-205	01/24/2008
>P	PURCHASE ORDER - RELEASED	2100-533	02/19/2008
>I	PURCHASE ORDER - RELEASED	2136-104	01/09/2008
>I	PURCHASE ORDER - RELEASED	2136-104	01/09/2008
>I	PURCHASE ORDER - RELEASED	2136-104	01/15/2008
>I	PURCHASE ORDER - RELEASED	2136-104	01/17/2008
>P	PURCHASE ORDER - RELEASED	2136-104	04/11/2008
>
>>Try putting your code in the Current event of the form.  BTW, "TYPE" is a
>>reserved word.
>[quoted text clipped - 5 lines]
>>>
>>>End Sub
>

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

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

0
ruralguy
1/29/2008 12:17:01 AM
BTW, a Select Case structure would be neater and easier to read.

mattc66 wrote:
>I tried the Current Event first and this is what happens. It grabs the first
>Trans_TYP and duplicates that for all records. I went ahead and changed the
>name of TYPE to nTYPE.
>
>TRANS_TYP	nTYPE	ITEM	DATE_DUE1
>P	PURCHASE ORDER - RELEASED	1201-205	01/24/2008
>P	PURCHASE ORDER - RELEASED	2100-533	02/19/2008
>I	PURCHASE ORDER - RELEASED	2136-104	01/09/2008
>I	PURCHASE ORDER - RELEASED	2136-104	01/09/2008
>I	PURCHASE ORDER - RELEASED	2136-104	01/15/2008
>I	PURCHASE ORDER - RELEASED	2136-104	01/17/2008
>P	PURCHASE ORDER - RELEASED	2136-104	04/11/2008
>
>>Try putting your code in the Current event of the form.  BTW, "TYPE" is a
>>reserved word.
>[quoted text clipped - 5 lines]
>>>
>>>End Sub
>

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

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

0
ruralguy
1/29/2008 12:18:11 AM
Can you give me suggestion on the Select Case structure. I am all for
cleaning it up. I thought the Select Case was limited on the number.

ruralguy wrote:
>BTW, a Select Case structure would be neater and easier to read.
>
>>I tried the Current Event first and this is what happens. It grabs the first
>>Trans_TYP and duplicates that for all records. I went ahead and changed the
>[quoted text clipped - 14 lines]
>>>>
>>>>End Sub
>

-- 
Matt Campbell
mattc (at) saunatec [dot] com

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

0
mattc66
1/29/2008 12:23:12 AM
Try this is a standard module:


Public Function ConvertType(strIn) As String
'-- Use:   YourNewField: =ConvertType([nType])

   Select Case strIn
      Case "S"
         ConvertType = "SALES FORECAST"
      Case "I"
         ConvertType = "INVOICE"
      Case "M"
         ConvertType = "FIRM PLANNED MFG ORDER"
      Case "F"
         ConvertType = "WORK ORDER"
      Case "R"
         ConvertType = "FIRM PLANNED PO"
      Case "P"
         ConvertType = "PURCHASE ORDER (RELEASED)"
      Case Else
         '-- Whatever you want
   End Select

End Function

AFAIK there is no practical limit.

mattc66 wrote:
>Can you give me suggestion on the Select Case structure. I am all for
>cleaning it up. I thought the Select Case was limited on the number.
>
>>BTW, a Select Case structure would be neater and easier to read.
>>
>[quoted text clipped - 3 lines]
>>>>>
>>>>>End Sub
>

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

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

0
ruralguy
1/29/2008 12:39:04 AM
Thank you - that worked great.

ruralguy wrote:
>Try this is a standard module:
>
>Public Function ConvertType(strIn) As String
>'-- Use:   YourNewField: =ConvertType([nType])
>
>   Select Case strIn
>      Case "S"
>         ConvertType = "SALES FORECAST"
>      Case "I"
>         ConvertType = "INVOICE"
>      Case "M"
>         ConvertType = "FIRM PLANNED MFG ORDER"
>      Case "F"
>         ConvertType = "WORK ORDER"
>      Case "R"
>         ConvertType = "FIRM PLANNED PO"
>      Case "P"
>         ConvertType = "PURCHASE ORDER (RELEASED)"
>      Case Else
>         '-- Whatever you want
>   End Select
>
>End Function
>
>AFAIK there is no practical limit.
>
>>Can you give me suggestion on the Select Case structure. I am all for
>>cleaning it up. I thought the Select Case was limited on the number.
>[quoted text clipped - 4 lines]
>>>>>>
>>>>>>End Sub
>

-- 
Matt Campbell
mattc (at) saunatec [dot] com

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

0
mattc66
1/29/2008 12:48:35 AM
You're welcome.  Glad I could help.

mattc66 wrote:
>Thank you - that worked great.
>
>>Try this is a standard module:
>>
>[quoted text clipped - 27 lines]
>>>>>>>
>>>>>>>End Sub
>

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

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

0
ruralguy
1/29/2008 2:30:41 AM
Reply:

Similar Artilces:

Importing into Excel from a Text file
We have a text database of about 7,000 rings. It is in a fixed format. Unfortunately some where we have about 4 or five rings whose format is screwed up. We figured by importing to Excel, we should be able to find where the records are to fix them. But, we just can't get the following format to import into excel. If anyone can help us, we sure would appreciate it! Thank you Greg Gates www.ringdesigner.com Each record begins with Begin Product Each record endswith EndProduct a semicolin seperates each record Also there are para symbols at the end of every line Herer are a...

How can I asign a number value to a text line in Excel?
tI have a Backgammon Club with Internal Club Rankings that are in Text. I want my members to report their wins - 1st, 2nd, and 3rd place - in tournaments to my web site . I would like them to imput: their nickname, date of tournament, tournament Room #, tournament points played for, and host of the tournament. I would further like the calculation to display any change in Ranking as a text cell. Additionally, I want to show for the member, how many more points are needed to get to the next levle and what that (Text)level is. If there is a "what if" for this please advise. Ri...

Formula argument based on text
Hi All, I have cells (A1:A10) populated with text ("Pass" or "Fail"). In cell (A11) I want to have a formula that returns the text: "pass" if all the cells (A1:A10) contain the text "pass" "fail" if any one of the cells (A1:A10) contains the text "fail". How would I write the formula to achieve this? Regards gregork In A11 enter: =IF(COUNTIF(A1:A10,"Fail")>0,"Fail","Pass") HTH "gregork" <gregork@paradise.net.nz> wrote in message news:0RXSb.19911$ws.2664893@news02.tsnz.net... > ...

new emails
When I start a new email the text looks very small and hard to read but when I look at it in my sent folder it looks fine.... why? Have you checked your zoom level already? See http://www.msoutlook.info/question/95 -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- "Mike Bunting" <Mike Bunting@discussions.microsoft.com> wrote in message news:228BBE80-21D2-4ADF-9048-CFB6C9DA3E9...

Outlook 2000 Starts with Information Box
On some computers running NT4 and Exchange 5.5 with XP pro Clients A message box appears about macros added to additional files, why does this box appear? and how do I stop it from appearing every time I sart Outlook 2000? Please state the full error you get. You can control macro's in Outlook by Tools-> Macro-> Security -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tips of the month: -Create your own fully customized Toolbar -Creating a Classic View in Outlook 2003 Subscribe to the new...

External Link-help!
Hi there, I am trying to get rid of an external link to my excel spreadsheet that I created. When I email the excel file to a coworker, the file asks to update links. But, I want to get rid of all the links so that when others open it, the message will not come up. Under the Edit menu, the Links option is not highlighted. Somehow, the external link got embedded into the file, and I need a solution to delete it out. My job is depending on this resolution! Thanks, Tina I could really use some help! Try Bill Manville's addin. It'll find those pesky ones. Findlink.zip ...

Combo Box from data in another tab
Is it possible to create a combo box from data that's in another tab? I have a combo box that's from data in hidden columns. But now I need to move all that hidden data to another tab in the same file. But when I go into properties and go to the ListFillRange option, it won't let me enter another tab name. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.aspx/ms-excel/200508/1 I have called data from another tab with a combo box by doing th following: First - name the range of the data on the other tab. This can be don with the shortcut on the toolbar (l...

!!HELP!! OWA ans Outlook do not synch
OK so I rebuilt my SBS 2003 server and used Exmerge to exmerge all my users mailboxes out. Successfully exmerged them back into Exchange. Had to recreate new profiles on the users workstations but all appears to be good. One slight problem. For my external users who use Citrix and log onto the Citrix server desktop they cannot use Outlook there. I do have a case open with Microsoft regarding this issue however my immediate issue to resolve is why I can log on as a user here in the office, open Outlook and all their mail is there. However when I use OWA the mailbox is incomplete. Does no...

forgot password?please help
I FORGOT MY PASSWORD ON MY MICROSOFT MONEY 2000 BUSINESS - PERSONAL I TRYED EVERY NAME AND NUMBER FOR 2 DAYS tsger@aol.com wrote: > I FORGOT MY PASSWORD ON MY MICROSOFT MONEY 2000 BUSINESS - > PERSONAL I TRYED EVERY NAME AND NUMBER FOR 2 DAYS That's got to be VERY FRUSTRATING! Not only that, but your CAPS LOCK KEY is stuck! I'm sorry for you! ...

need a bit of help.....
I have generated a form that shows money amounts. yet i want two colums that separates the dollar amount from cents. I have for example colum *H* as the dollar amount and colum *I* as the cent amounts. Now i have tried Format Cell to set it up but it doesnt work. for example i tried the custom format for the dollar amount and it rounds it. and if there's an amount of 1108.83 the cell will show 1109. so it does not show the true value amount. i also tried the same approach with the =RIGHT(H1,2) but with the left and Mid but still didnt work, because i would have to enter the same amount o...

MSP 2007 resources help
Hi all, Three questions: 1. What the constraint A<B,C means and how can I entering in the MSP? 2. I have 3 kinds of human resources. Lets say for example, kind A are engineers. I have 8 of them and everyone is costing 1500 Euros/month. Task A needs 4 engineers. How can I assign them to the task and add the appropriate cost? 3. I have 3 machines as a resource. Each machine has a usage cost of 3000 euros per task and function cost 2400 euros per month. How can I assign them in the appropriate tasks? And how can I distribute their cost? Thank you in advance -- - Hello...

Help! page range prob in print
Hi I worked on print.Everythings working perfectly except one problem.ie. When i set the PageRange option to 'ALL' option and press print button..instead of displaying only the pages which has information ..its displaying that all pages from 1 to 65535 r going to be printed. How do i remove this problem? thanks, vani I thing you may failed to set the maximum number of pages to print. Check CPrintInfo::SetMaxPage(nMaxPage); method regds Jibesh -- ------------------------------------------------------------------------- FIGHT BACK AGAINST SPAM! Download Spam Inspecto...

Link Help!!!
hi, How can I add or remove link from “My Work” under workplace, like Calendar or Reports...? And where the file sitelog.xml?? thnx, ...

shortcut ket to change formatting of text
hey, whats the shortcut key to change numbers to dates, and vice versa. cheers : -- Message posted from http://www.ExcelForum.com Hi! This may be the sort of thing you want: CTRL+SHIFT+# Apply the Date format with the day, month, and year. This is a quote from Excel Help ( use "Keyboard shortcuts" for th search) Al -- Message posted from http://www.ExcelForum.com ctrl-1 will pop up the Format|cells dialog ctrl-~ (ctrl-tilde, aka ctrl-shift-backquote on my USA Keyboard) will format a cell as General ctrl-# (ctrl-shift-4) will format as d-mmm-yy Try searching excel's...

sum numbers and ignore text
Hi there, I need some help please. I have a row of numbers and text and I need to sum the numbers only. How to do? a1 a2 a3 a4 a5 1 dnr 3 4 dnr total 8 thanks in anticipation ditchy Ditchy, a simple SUM formula will do it, since the SUM worksheet function ignores text values. So in your example, it's =SUM(A1:A5). -- DDM "DDM's Microsoft Office Tips and Tricks" Visit us at www.ddmcomputing.com "ditchy" <ditchy@ncable.net.au> wrote in message news:dda1ad29.0405221934.5787f60f@posting.google.com... > Hi there, I need some help please. I have a row...

trendline HELP!
I have a chart that i am making of PPMs for the year of 2006. I have jan-may in the data series and the rest are left blank. I am trying to get a trendline in where it will stop at whatever month I am at but update when a new month's data is entered into the box. However, I cannot figure out how to do this, when I do have a trend line it goes to like -4000. can anyone help me please? Make a dynamic chart: http://peltiertech.com/Excel/Charts/Dynamics.html http://www.tushar-mehta.com/excel/newsgroups/dynamic_charts/index.html http://www.stfx.ca/people/bliengme/ExcelTips/Dynamic.htm...

Help what kind of formula?
I've used Excel formulas in a basic way (sums, averages, divisions, and multiplication of cell data) for about a year. I came across this formula today for a project I need to complete. I've never seen the "SUMIF" or the dollar symbol, OR the ampersand! After hilighting the formula to see if I could just figure it out, I'm stumped. Any chance someone could explain what function these symbols serve Here is the formula =SUMIF($D$3:$D$28,"="&$C38,H$3:H$28) :confused: -- Emil0 ------------------------------------------------------------------------ Emil...

Was this post helpful to you?
Hi gang, Just curious about the Yes, No selection on the question, "Was this post helpful to you? " In a case where I posted a question and received numerous helpful responses, which collectively provided the final solution, do I select Yes for each response that was helpful, or just select Yes on the very last post when the topic has ended? Thanks Peter On Sun, 12 Aug 2007 13:44:01 -0700, Petermgr <Petermgr@discussions.microsoft.com> wrote: >Hi gang, > >Just curious about the Yes, No selection on the question, "Was this post >helpful to you? "...

Need help from fellow Admin about Mailbox sizes
I need a little help from some fellow Admins that have successfully created some policies about mailbox limits. Currently I am fighting the small company mentality in a growing company. We have about 150-200 mailboxes and I am looking for some suggestions on at what size is a good idea to start the warning messages, then stop send and then stop all traffic. I have some users that are getting to the 2GB size. What do you guys suggest? Thanks in advance. There is no standard or best practice for quota settings except that you should set a limit, even if a high one, for "Prohibi...

Default workbook not coming up help
The workbook I have made is in Excel startup folder and used to come u on launch and file, new or command new. Now only comes up on relaunch and command N, brings up a default workbook. Any ideas appreciated thanks -- Message posted from http://www.ExcelForum.com ...

Typing text is impossibly slow in text boxes when in publishing layout
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel When I try to type or edit text in a text box in a template document (a newsletter template) the typing, editing, deleting, backspacing or what ever, is absolutely impossibly slow. Am I doing something wrong or do I have something set up wrong. If it remains this way I will not be able to work in this program. Apart from using Publishing Layout View, I suspect you are not doing anything wrong. Publishing Layout View requires very powerful hardware, and even then it tends to crash a lot. If I were you...

Function Help?
I need a function that will count back all previous rows for th farthest digit back in the R, S and T cells and place it in the column. The furthest digit back: each of the 3 cells being evaluated ( S and T) have single digit values which have occurred in previous R, T cells, but the value which last appeared in the earliest row is th value which the furthest back. I want the function to count how man rows since the last time that value last occurred. See sample below the N column has the correct answers: Example: .................R..S...T........N row 11:....9...0...6 row 12:....7...5.....

Newbie needs help with first scatter plot
I have a query with two fields: a date and a list of repeating words. Something like 1/1/2007 Red 1/3/2007 Green 2/9/2007 Blue 3/1/2007 Red 3/3/2007 Blue I want to create a simple scatter plot with Date on the X-axis and Color on the Y-axis (there's only seven possible values for the words, so I'd like each word on the Y-axis and a dot in the plot above each date where it occurs). When I use the Chart wizard and select Scatter Plot, the wizard is generating charts that plot *counts*, rather than showing a single dot for each time it occurs. I thought what I wanted to do was pre...

selecting text in a document
Hi All, I have a macro that seeks out a particular string of text in a document and then moves down one line and selects the remaining text nin the document and writes it to a variable and then uses it subsequently in the message section of an email. Recently this method has been failing because the text is not being selected. I don't know if the PC was in EST mode a the time but I need the macro to work no matter what. The code I use is as follows Selection.HomeKey wdStory Selection.Find.Execute "Issued at" Selection.MoveDown wdLine...

Desperately need help!!
Is it impossible to do an inventory system in excel? I've tried on numerous occasions for the past month to get a simple inventory system to work and i'm having no luck. I've gotten to the point where my only problem is having a correct record of stock available. I want to be able to see the correct number of a particular item available whenever i do stock taking. So far, what i've done is use iteration to update the stock figure and have sales deducted from that and the new figure shown in quantity avalable. The problem is 1. the iteration does not stop and its set to 1....