473,386 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to only allow users to select from combo but not type in

Hi i have two tables namely products and sales. both have fields called 'product name' and 'product ID'.i have also created two forms for inserting data in to the tables. on the sales form the product and product id fields are connected to products table as the data source. some users when entering data into the sales table and find that the product name is not there, lets say the product has not been added in the products table so its empty. they decide to type in directly, this leaves my products table empty yet the sales table appear to have products. how do i solve that by only allowing them to select from the combo box but not to type in? regards
Jun 25 '10 #1
3 1475
jimatqsi
1,271 Expert 1GB
There is a "limit to list" property. Set that to "yes" and new entries cannot be made.

There is also an event, "On Not in List", which allows you to execute some program code in the event they type in something that is not in the list. Using that, you could automatically add an new item to both tables or force some limits on what they add.

Jim
Jun 25 '10 #2
@jimatqsi
Thanks so much jim, i,ve tried the limit to list and works fine. by the way kindly give me the code to type in the event so that after up date the same should also be added to the other table, i,m really a newbie in VB programming. tables are product and sales. fields in the two tables are [product name] and [product ID]. regrads, gerry
Jun 25 '10 #3
jimatqsi
1,271 Expert 1GB
It would be something like this
Expand|Select|Wrap|Line Numbers
  1. dim dbs as dao.database (I'm assuming DAO)
  2. dim rsProducts as dao.recordset
  3.  on error goto ErrorStuff
  4. set dbs = currentdb
  5. set rsProducts=dbs.Openrecordset("tblProducts",dbopendynaset,dbseechanges)
  6. rsproducts.addnew
  7. rsproducts![product ID]=me!newproductid
  8. rsproducts![Product name] = me!newproductname
  9. rsproducts![other stuff as needed] = me!othernewstuff
  10. rsproducts.update
  11.  
  12. rsproducts.close
  13. set rsproducts= nothing
  14. set dbs = nothing
  15.  
  16. exit sub
  17.  
  18. ErrorStuff: resume next ' or display message or whatever u want
Jun 25 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Lars Netzel | last post by:
Hi How do I in a textbox only allow users to type in numbers and comma and dot ? they should of course be able to delete and backspace the stuff they type in too.. I figured keyDown would...
5
by: profdotnet | last post by:
Below is the code of web.config file: <configuration> <system.web> <authentication mode="Forms" /> <authorization> <allow users="Admin"/> <deny users="Jack,Mary" /> <deny users="?">...
3
by: Dave Marden | last post by:
Is it possible to allow a person whom navigates to a particular page to type in a URL to a website they visit often, and have it be treated like code on the page itself for them to use it as a...
1
by: Laurence | last post by:
Hi folks, In the middle of page 231 on the book "Administration Guide - Implementation" stated - "In addition to these package privileges, the BINDADD database privilege allows users to create...
10
by: Bishman | last post by:
Hi, I need to programmatically allow or disallow the selection of multiple checkboxes on a form . At certain times I only want to allow a single selection, at other times I may wish to allow...
0
by: pradeep | last post by:
Hello, I have problem in PHP String concatination with html select combo box. There are 3 files addressbook.sql : concat1.php concat2.php
18
by: =?Utf-8?B?VG9t?= | last post by:
is it possible to add a bunch of users to group and only allow group to access the web page or do I need to add each user to the web.config file? Or is there another way to do this? I just took...
5
by: tkba | last post by:
Hi All, Please help me to understand if I can add calendar to a date field in forms which will allow users to enter the date. Regards, TK
14
by: Heggr | last post by:
I have a page that when you click on a button it is supposed to add 5 more rows to an existing table. This functionality works but then we had to change one of the cells from using a Text box to...
7
by: usr123 | last post by:
Hi, I need a multi select combo box on ASP page. Scenario: on page there is a table with few columns. In multi select box, i need all the table columns,let user select a few, and show only...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.