Check text field value against underlying table or query of combo box

Hello,
I have a form on which the user can enter new records or update
existing ones.
If the user enters a new record on the form, I would like to have an
'After Update' event on one of the text fields, which is the item# to
check if the value entered already exists in the underlying table,
tbl_item. How can I call the table from the 'After Update' event of
the text field and check for that value in the table?

Thanks in advance.

Regards,
A. Crawford

0
antcraw
3/16/2007 4:49:24 PM
access.formscoding 7494 articles. 0 followers. Follow

1 Replies
1077 Views

Similar Articles

[PageSpeed] 35

antcraw@swbell.net wrote:
>I have a form on which the user can enter new records or update
>existing ones.
>If the user enters a new record on the form, I would like to have an
>'After Update' event on one of the text fields, which is the item# to
>check if the value entered already exists in the underlying table,
>tbl_item. How can I call the table from the 'After Update' event of
>the text field and check for that value in the table?

If Me.NewRecord Then
	If DCount("*", "table", "[item#]=" & Me.textbox)= 0 Then
		'  item is not in table
		. . .
	Else
		' item already in table
		. . .
	End If
End If

-- 
Marsh
MVP [MS Access]
0
Marshall
3/16/2007 8:52:24 PM
Reply:

Similar Artilces:

Convert Cell Text to Matching Hyperlink?????
We have an Excel spreadsheet that contains information to scanned images being populated into our engineering database. In the spreadsheet there is information as to the creation time and date, size, title and other related information. One of the columns is the name and location of the actual TIFF image file. This field is just text. What we would like to do is convert the cell from just text stating the location and filename to a hyperlink pointing to the specific file. For example, the cell contents state : G: \folder2007\subfolder0320\00001234.tif We would like to still have the tex...

Large amount of cell text
Hi, We have a case where we have received records from a Hotmail subpoena. Microsoft has put the records in an Excel spreadsheet with all emails for a six month period being contained in a single column and tens of thousands of rows. The problem I am having is that some of the cells that contain the text from the email messages are very long, and makes reading of the cells difficult. An attempt to save to or publish to a different format for easier reading causes truncation of the text in those particular cells. Word Wrap, Autofit, nor simply double-clicking on the cell margin d...

merge MSN Bill Pay & Checking Acct
I want to merge my checking account with MSN Bill Pay but only see that I can merge MSN Bill Pay with my checking account (i.e., you lose all of your checking account information). Does any one have any suggestions? -- cheers, Tom G ...

Returning highest value
I have a list with value_name and its value. Is there a formula tha can look down the list and pick the highest value and return th value_name For example _Value_Name_ _Value_ Value A 5 Value B 10 Value C 33 Value D 8 Value E 51 Value F 32 Value G 47 Value H 9 Value I 41 So the formula would return Value E as its result. Would be much appreciated : -- Fishbon ----------------------------------------------------------------------- Fishbone's Profile: http://www.excelforum.com/member.php?action=getinfo&...

VBA solution to paste text into megred cells
I do realize that merged cells are bad news. I'm stuck with an Excel 2003 worksheet, which contains this dreaded feature. Users are complaining that on trying to paste text into merged cells gives Excel Warnings: "Data on the Clipboard is not the same size and shape as the selected area. Do you want to paste anyway?" And: "Cannot change part of a merged cell." Interestingly, though if the user hits F2, which places the cursor in the formula bar, then the paste operation works! I'm usually reasonably of Ok with VBA; but this ...

How can i change value of number to zero, when i have
How can i change value of number to zero, when i have 00000.000 "" formula rezult? For example A1=00000.000 "E" A2=00000.000 "E" The SUM value of A1 and A2 is 00000.000 "", but I need that rezult would display like 0 "" if there is no whole numbers in A1 and A2. Thanks for helping :) Have you tried using the format cell option. r-click -> Format Cells -> Number tab -> select Number in the window and you can specify the decimal places, and there are custom options as well. I'm not a guru, but if it works, i...

Resource / Project level enterprise fields as dimensions in msp_project_timesheet
When I try to use Resource or Project level enterprise fields as dimensions in msp_project_timesheet, my actual billable hours always goes to zero. The actual billable hours reports correctly when I use the dimensions inherent to the timesheet. Is there a solution to this besides building my own virtual cube or writing a custom report against the reporting database? These were the two options I found in old posts. Was this problem fixed in a service pack that I missed? Thanks for your help. ...

Authorizing checks with RMS
I recently removed PCCharge and setup my syetm to work with a preferred merchant provider to allow native processing of credit & debit cards. Since check verification/authorization was handled by PCCharge to Telecheck, check authorization is now not being done. How is check authorization accomplished using a preferred provider? Thanks, Richard Unfortunately, it's not. PC Charge is the only option for check processing in RMS as far as I know. TPI or some other vendor may support it through an add-in, but RMS as shipped has no way of doing both checks and debit... -- -- Gle...

Check names not working for multiple address books / contacts
Hello! I have upgraded from outlook 2003 to outlook 2007, my contacts are stored in pst. I used to be able to search for a name via check names and it displayed me all the results from global address list and from my contacts, but now it only does one. It does not matter which one I set in the checking order, whichever is top will be the one that provides the result. I would like it to show me both results, how would I go about to set that up? Thank you Deana More accurate and complete information would be helpful. The Global Address List is only available to those who c...

Sorting Items in a Combo Box...
I have a Combo Box that is sub-classed. I want the items in the list to be sorted by the lParam of the item and then alphabetically (upper and lower case separately). The dialog control being sub-classed has the Sort property set to true, but it isn't sorting them, or if it is, it is doing so in reverse of what I want. For example, the list contains "r, D, .s, .., and ." which is the order is displays them in from top to bottom, but I want the reverse ("., .., .s, D, r"). I tried setting up the CompareItem(), but it doesn't seem to be called. FWIW: - The Co...

How do I create Check list
1.I am new to excel and want to create a simple check list. I would like to have the first column check boxes and then the following columns discription and notes. Can someone give me a step by step on how to do this. I have created spread sheets but am not familiar with check boxes. 2.Also, Can someone tell me the difference between Access and Excel? Geek 1) Not sure what you're aiming to do with the checkboxes, but if you right click on the toolbar area, you will get a list of available toolbars. You want either the 'forms' toolbox or the 'controls' toolbox. Genera...

Check text field value against underlying table or query of combo box
Hello, I have a form on which the user can enter new records or update existing ones. If the user enters a new record on the form, I would like to have an 'After Update' event on one of the text fields, which is the item# to check if the value entered already exists in the underlying table, tbl_item. How can I call the table from the 'After Update' event of the text field and check for that value in the table? Thanks in advance. Regards, A. Crawford antcraw@swbell.net wrote: >I have a form on which the user can enter new records or update >existing ones. >If the us...

Restore pick list values
We edited the invoice 'status reason' picklist ( actualy deleted some values ) and modified others. This we have done on other picklists with no problems. However we have noticed that when this attribute is displayed on selection lists the text displayed is not the same as that on the picklist. We now presume there is code behind particular list values and want to restore the old values with the same list value. We have a backup of the DB available through enterprise manager and can see the missing records there in STRINGMAP and STRINGMAPBIT . We are missing values 4,5, 6 and a...

Preventing multiple check boxes from being checked
I have a worksheet with over 20 rows of check boxes with 5 check boxes in each row. (from the forms toolbox) I would like to prevent the user from checking more than one box in each row. Is this possible? BTW, this forum has been a great help. I'm so glad that expert Excel users are so willing to share their wealth of knowledge. Thanks again. Jae Put them in a group box, again from the forms toolbar. Drag the group box onto the sheet, then drag the checkboxes in. -- HTH RP (remove nothere from the email address if mailing direct) "Jae" <Jae@discussions.micro...

Printing Checks
I'm having a problem printing checks from Money 2003. I have three accounts that come up in one .mny file. Two of the accounts use 3-on-a-page checks and I want the name and address printed on them. One account uses voucher checks and needs to be nudged a little south. When I go to print checks I have to be aware of what account I'm in and change the settings by hand to make sure the checks print correctly. How can I make the check-print settings stick with the account I'm using. It's a pain to have to remember every time. I'm frequently forgetting and screwing up a pag...

querying unrelated tables
I have two tables - Employee_PunchTime table and Holidays Table. The PunchTime table contains three fields representing EmployeeID, Time-in and Time-out; and the Holiday table contains two fields representing name of holiday and the date. If the payroll period is 5/31/2010 (Mon) thru 6/4/2010 (Fri) and 5/31/2010 is a paid holiday, I need to create a query that shows punched time and paid holiday on a separate column. On the paid holiday, there would obviously be no Time-In and Time-Out record. It will look something like this: EmpID Date Time-in Time-out Paid ...

How do I turn off the text to speech facility in Exccel?
I am trying to turn off the text to speech facility in Excel. Please help. On Sat, 4 Jun 2005 01:29:26 -0700, "David Boas" <David Boas@discussions.microsoft.com> wrote in microsoft.public.excel.misc: >I am trying to turn off the text to speech facility in Excel. Please help. On the Speech toolbar, click Speak On Enter, the rightmost button. See also Help: "Turn off speech playback" where it says: Turn off speech playback Do one of the following: To turn off all speech playback, click Stop Speaking on the Text To Speech toolbar. To turn on or...

No Programs are showing up in the ADD/Remove program Box
XP Home to XP Pro Upgrade - clean install. Interestingly enough System Retore is disabled/stopped and I can not restore the service. Tried Regedit and looked for prog names >63 char, but none found under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall. Any suggestions.... "Matthew" <Matthew@discussions.microsoft.com> wrote in message news:494DD812-4BDD-473D-9936-5FBE50DE2F4D@microsoft.com... > XP Home to XP Pro Upgrade - clean install. > Interestingly enough System Retore is disabled/stopped and I can not > restore >...

Text problems
Using a newsletter created by Publisher 2000, opening the newsletter in Publisher 2002 and saving as a web page some of the text lines are over writen by the next line and the text that fills a column in the newsletter leaves a lot of white space at the bottom of the column. Is there any way to fix this problem or do I continue to use Publisher 2000 and give up on Publisher 2002? Thanks for any help any one can give. Bill ...

Update Rowsource Records in unbound combos
If I have an unbound combo box with a Rowsource that includes an "autonumberd" ID field, AND, I want to update one of the other fields in current row, how do I go about doing that? Say my Rowsource is comprised of a record: MyID, MySpecialValue, MyTextField and, I want to update MySpecialValue. Bill On Thu, 15 Feb 2007 19:52:57 GMT, Bill wrote: > If I have an unbound combo box with a Rowsource > that includes an "autonumberd" ID field, AND, I want > to update one of the other fields in current row, how > do I go about doing that? > > Say my Rows...

What table are notes stored in?
I have notes linked to Cases, but I can't find the SQL table they are in! Can anyone help? Thanks! Nevermind, I found it: AnnotationBase "AW" wrote: > I have notes linked to Cases, but I can't find the SQL table they are in! > Can anyone help? Thanks! AW, annotationbase. HTH, Dave ------------------------------------------------- David L. Carr, President Visionary Software Consulting, Inc. Main #: 971-327-6944 Introducing our newest software product... VAST - an auditing solution for Microsoft CRM 1.2 VAST shows you "Who Did What When" in Micros...

why can't i type in plain text control boxes?
I am building a template in Word 2007. In the content controls I have the option of using rich text or plain text. When I choose the plain text and protect the document to filling in forms I can not type in the content control box. Yet when I use Rich text I can't tab over to the next content control box as it tabs within the control box. All I want to be able to do is type in the control box and be able to tab to the next. Did you by any chance set the text controls so they cannot be edited? Undo that and you should be able to tab from text control to text control with ...

Counting multiple values in a single cell
I have a cell which contains multiple values set out like this: 3; 4; 7 I would like to be able to count the number of values (3) in this cell. Does anybody know how I could do this???? -- ac8038 ------------------------------------------------------------------------ ac8038's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=6054 View this thread: http://www.excelforum.com/showthread.php?threadid=553526 You could use =SEARCH("3",A1) where A1 is the cell with the data. Be aware however tha it will also match 31, 33 (twice) etc. Matt -- Mallyca...

Employee Check Format-Graphical
Does anyone know of a TK that shows how to convert one of the employee check from a text report to a graphical report? We do not have Direct deposit, I looked in the Report Downloads from Great Plains and did not see one there either. thanks -- Doug There's no secret here. Just un-check the "Text Report" option in the Report Definition window. And then modify the report so it looks like you want it. This will take some time. The reports don't transfer from text to graphical nicely. "Doug" wrote: > Does anyone know of a TK that shows how to convert...

MultiValed Fields
I could be way off here, but I have over 60 fields (numeric fields that are scored 1-100) which represent observations of specific items that occur (are repeated) at different date-times for multiple subjects (SubID). The numeric fields are defaulted to be zero and I am having diffculty, for example, with selecting all fields >1 or >30 or >60 without querying them one at a time. Does it make sense for me to make a table and place all of these fields in a multi-valued field so I can then query the field for those criteria? Thanks No: don't use MVF for that. Whatever...