dbTalk Databases Forums  

Combo Box allows blanks

comp.databases.ms-access comp.databases.ms-access


Discuss Combo Box allows blanks in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jovii
 
Posts: n/a

Default Combo Box allows blanks - 07-27-2009 , 10:31 AM






Hi all,

I'm having a problem with a combo box. The combo box shows broker
id's and broker name. The bound field is broker id, the limit to list
property is set to Yes and the Default Value is set to zero. The
broker id is defined in the details table as a number (integer).

If a user enters the wrong broker id a message pops up: The text you
entered isn't an item in the list, but if a blank is entered (hitting
the space key by accident) no message pops up and the record will be
saved with a blank broker id.

Is there another property that needs to be set in combo box or in
the table that will not allow a blank to be entered?

I am using Access 2007

Joe V.

Reply With Quote
  #2  
Old   
Keith Wilby
 
Posts: n/a

Default Re: Combo Box allows blanks - 07-27-2009 , 10:52 AM






"jovii" <jovi07 (AT) aol (DOT) com> wrote

Quote:
Hi all,

I'm having a problem with a combo box. The combo box shows broker
id's and broker name. The bound field is broker id, the limit to list
property is set to Yes and the Default Value is set to zero. The
broker id is defined in the details table as a number (integer).

If a user enters the wrong broker id a message pops up: The text you
entered isn't an item in the list, but if a blank is entered (hitting
the space key by accident) no message pops up and the record will be
saved with a blank broker id.

Is there another property that needs to be set in combo box or in
the table that will not allow a blank to be entered?

I am using Access 2007

Joe V.
Try setting the field's "allow zero-length" property to "no".

Keith.
www.keithwilby.co.uk

Reply With Quote
  #3  
Old   
Steve
 
Posts: n/a

Default Re: Combo Box allows blanks - 07-27-2009 , 10:56 AM



You have a couple of errors ........
1. The default value can not be 0. There is no BrokerID and BrokerName
with a BrokerID = 0 in the table where you get BrokerID and BrokerName.
2. In the table where you are entering BrokerID with the combobox,
BrokerID should be defined as a number (long integer).

Steve
santus (AT) penn (DOT) com

"jovii" <jovi07 (AT) aol (DOT) com> wrote

Quote:
Hi all,

I'm having a problem with a combo box. The combo box shows broker
id's and broker name. The bound field is broker id, the limit to list
property is set to Yes and the Default Value is set to zero. The
broker id is defined in the details table as a number (integer).

If a user enters the wrong broker id a message pops up: The text you
entered isn't an item in the list, but if a blank is entered (hitting
the space key by accident) no message pops up and the record will be
saved with a blank broker id.

Is there another property that needs to be set in combo box or in
the table that will not allow a blank to be entered?

I am using Access 2007

Joe V.

Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: Combo Box allows blanks - 07-27-2009 , 11:37 AM



jovii wrote:

Quote:
Hi all,

I'm having a problem with a combo box. The combo box shows broker
id's and broker name. The bound field is broker id, the limit to list
property is set to Yes and the Default Value is set to zero. The
broker id is defined in the details table as a number (integer).

If a user enters the wrong broker id a message pops up: The text you
entered isn't an item in the list, but if a blank is entered (hitting
the space key by accident) no message pops up and the record will be
saved with a blank broker id.

Is there another property that needs to be set in combo box or in
the table that will not allow a blank to be entered?

I am using Access 2007

Joe V.
Do you have a record in the combo's record source that is blank?

Reply With Quote
  #5  
Old   
jovii
 
Posts: n/a

Default Re: Combo Box allows blanks - 07-27-2009 , 01:48 PM



Thanks for the replys. The problem was solved when I changed the
Required property on the brokerid field to Yes


On Jul 27, 12:37*pm, Salad <o... (AT) vinegar (DOT) com> wrote:
Quote:
jovii wrote:
Hi all,

* *I'm having a problem with a combo box. The combo box shows broker
id's and broker name. The bound field is broker id, the limit to list
property is set to Yes and the Default Value is set to zero. The
broker id is defined in the details table as a number (integer).


Quote:
* If a user enters the wrong broker id a message pops up: The text you
entered isn't an item in the list, but if a blank is entered (hitting
the space key by accident) no message pops up and the record will be
saved with a blank broker id.

* Is there another property that needs to be set in combo box or in
the table that will not allow a blank to be entered?

I am using Access 2007

Joe V.

Do you have a record in the combo's record source that is blank?

Reply With Quote
  #6  
Old   
jovii
 
Posts: n/a

Default Re: Combo Box allows blanks - 07-27-2009 , 01:52 PM



On Jul 27, 11:56*am, "Steve"
<help_available_at_very_reasonable_ra... (AT) contactme (DOT) com> wrote:
Quote:
You have a couple of errors ........
1. * *The default value can not be 0. There is no BrokerID and BrokerName
with a BrokerID = 0 in the table where you get BrokerID and BrokerName.
2. * *In the table where you are entering BrokerID with the combobox,
BrokerID should be defined as a number (long integer).
Steve,

1. The default value can be 0 because a broker might not be involved
in the trade. 0 is a valid selection in the combo box
2. The brokerid field is defined as a number (integer). Any reason
why you prefer long integer instead of integer?



Quote:
Steve
san... (AT) penn (DOT) com

"jovii" <jov... (AT) aol (DOT) com> wrote in message

news:9a267dc6-07e9-495d-9b39-42d957753828 (AT) o32g2000yqm (DOT) googlegroups.com...

Hi all,

* I'm having a problem with a combo box. The combo box shows broker
id's and broker name. The bound field is broker id, the limit to list
property is set to Yes and the Default Value is set to zero. The
broker id is defined in the details table as a number (integer).

*If a user enters the wrong broker id a message pops up: The text you
entered isn't an item in the list, but if a blank is entered (hitting
the space key by accident) no message pops up and the record will be
saved with a blank broker id.

*Is there another property that needs to be set in combo box or in
the table that will not allow a blank to be entered?

I am using Access 2007

Joe V.

Reply With Quote
  #7  
Old   
Steve
 
Posts: n/a

Default Re: Combo Box allows blanks - 07-27-2009 , 08:14 PM



See commnts below .....


"jovii" <jovi07 (AT) aol (DOT) com> wrote

On Jul 27, 11:56 am, "Steve"
<help_available_at_very_reasonable_ra... (AT) contactme (DOT) com> wrote:
Quote:
You have a couple of errors ........
1. The default value can not be 0. There is no BrokerID and BrokerName
with a BrokerID = 0 in the table where you get BrokerID and BrokerName.
2. In the table where you are entering BrokerID with the combobox,
BrokerID should be defined as a number (long integer).
Steve,

1. The default value can be 0 because a broker might not be involved
in the trade. 0 is a valid selection in the combo box

Wrong! BrokerID should be autonumer in your Broker tables. Autonumber is
Long Integer. Therefore, all relationships to BrokerID in the broker table
must be long integer. Access requires that the primary key and the foreign
key in a relationship be the same data type.

2. The brokerid field is defined as a number (integer). Any reason
why you prefer long integer instead of integer?

It's an Access requirement! See #1



Quote:
Steve
san... (AT) penn (DOT) com

"jovii" <jov... (AT) aol (DOT) com> wrote in message

news:9a267dc6-07e9-495d-9b39-42d957753828 (AT) o32g2000yqm (DOT) googlegroups.com...

Hi all,

I'm having a problem with a combo box. The combo box shows broker
id's and broker name. The bound field is broker id, the limit to list
property is set to Yes and the Default Value is set to zero. The
broker id is defined in the details table as a number (integer).

If a user enters the wrong broker id a message pops up: The text you
entered isn't an item in the list, but if a blank is entered (hitting
the space key by accident) no message pops up and the record will be
saved with a blank broker id.

Is there another property that needs to be set in combo box or in
the table that will not allow a blank to be entered?

I am using Access 2007

Joe V.

Reply With Quote
  #8  
Old   
jovii
 
Posts: n/a

Default Re: Combo Box allows blanks - 07-27-2009 , 10:24 PM



Why should brokerid be an autonumber. I work for a small company and
there are only 15 brokers and the office manager prefers to assign
brokerid himself.
Since the broker id in the details table and the broker id (primary
key) in the brokers table are both defined as integer it meets the
Access requirement.



On Jul 27, 9:14*pm, "Steve"
<help_available_at_very_reasonable_ra... (AT) contactme (DOT) com> wrote:
Quote:
See commnts below .....

"jovii" <jov... (AT) aol (DOT) com> wrote in message

news:9576522d-bb33-489a-8da2-82478eea586a (AT) k19g2000yqn (DOT) googlegroups.com...
On Jul 27, 11:56 am, "Steve"<help_available_at_very_reasonable_ra.. . (AT) contactme (DOT) com> wrote:
You have a couple of errors ........
1. The default value can not be 0. There is no BrokerID and BrokerName
with a BrokerID = 0 in the table where you get BrokerID and BrokerName.
2. In the table where you are entering BrokerID with the combobox,
BrokerID should be defined as a number (long integer).

Steve,

1. *The default value can be 0 because a broker might not be involved
in the trade. 0 is a valid selection in the combo box

Wrong! BrokerID should be autonumer in your Broker tables. Autonumber is
Long Integer. Therefore, all relationships to BrokerID in the broker table
must be long integer. Access requires that the primary key and the foreign
key in a relationship be the same data type.

2. *The brokerid field is defined as a number (integer). Any reason
why you prefer long integer instead of integer?

It's an Access requirement! See #1



Steve
san... (AT) penn (DOT) com

"jovii" <jov... (AT) aol (DOT) com> wrote in message

news:9a267dc6-07e9-495d-9b39-42d957753828 (AT) o32g2000yqm (DOT) googlegroups.com....

Hi all,

I'm having a problem with a combo box. The combo box shows broker
id's and broker name. The bound field is broker id, the limit to list
property is set to Yes and the Default Value is set to zero. The
broker id is defined in the details table as a number (integer).

If a user enters the wrong broker id a message pops up: The text you
entered isn't an item in the list, but if a blank is entered (hitting
the space key by accident) no message pops up and the record will be
saved with a blank broker id.

Is there another property that needs to be set in combo box or in
the table that will not allow a blank to be entered?

I am using Access 2007

Joe V.

Reply With Quote
  #9  
Old   
Keith Wilby
 
Posts: n/a

Default Re: Combo Box allows blanks - 07-28-2009 , 02:56 AM



"jovii" <jovi07 (AT) aol (DOT) com> wrote

Quote:
Why should brokerid be an autonumber. I work for a small company and
there are only 15 brokers and the office manager prefers to assign
brokerid himself.
Since the broker id in the details table and the broker id (primary
key) in the brokers table are both defined as integer it meets the
Access requirement.
You can largely disregard most of what Steve says, when he isn't trolling
for victims he's giving dodgy advice.

Reply With Quote
  #10  
Old   
jovii
 
Posts: n/a

Default Re: Combo Box allows blanks - 07-28-2009 , 11:49 AM



Thanks for the warning Keith. I thought Steve may know something that
I didn't, but I can see know he's just wasting time.



On Jul 28, 3:56*am, "Keith Wilby" <h... (AT) there (DOT) com> wrote:
Quote:
"jovii" <jov... (AT) aol (DOT) com> wrote in message

news:14b66deb-e2b5-4870-b797-40875eb7c3fd (AT) k19g2000yqn (DOT) googlegroups.com...

Why should brokerid be an autonumber. *I work for a small company and
there are only 15 brokers and the office manager prefers to assign
brokerid himself.
Since the broker id in the details table and the broker id (primary
key) *in the brokers table are both defined as integer it meets the
Access requirement.

You can largely disregard most of what Steve says, when he isn't trolling
for victims he's giving dodgy advice.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.