By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 1,847 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

drop box doesnt ad new record?

P: n/a
Hi,

Can someone help me to create a drop box where I can also add new records?

Here is the problem:

I m working on a form with a drop box.
When I select a '"name" in the drop box the form will change to that record.
This is ok

If I type a new "name" in the box and press enter, the record will be safed
with the new"name" and I will loose the old "name"
And what I want is that after typing a new"name" the record changes to a
blank record

The "name" is the primary key.

I also did a test with the auto ID as primary key and then I cant add a
new"name".

I have heard that its better not to make the auto ID the Primary record, but
I cant remember why :)

Greetings,
Xiphias
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Xiphias" <Am*******@yahoo.com> wrote in message
news:40***********************@news.wanadoo.nl...
Hi,

Can someone help me to create a drop box where I can also add new records?

Here is the problem:

I m working on a form with a drop box.
When I select a '"name" in the drop box the form will change to that record.
This is ok

If I type a new "name" in the box and press enter, the record will be safed
with the new"name" and I will loose the old "name"
And what I want is that after typing a new"name" the record changes to a
blank record

The "name" is the primary key.

I also did a test with the auto ID as primary key and then I cant add a
new"name".

I have heard that its better not to make the auto ID the Primary record, but
I cant remember why :)


I'm a bit confused by what you're describing. There are two standard uses for a
ComboBox on a form. To enter data in the current record when the ComboBox is
bound to a field in the table or to navigate amongst the records displayed in
the form. You can't use it simultaneously to do both.

If the ComboBox is bound then it should never cause your form to "Change to a
different record". If it is set up for navigation then it should never change
the entry on the current record.

If you are using a bound ComboBox for data entry and you want to enter a new
record then you need to navigate to the new record position *before* you make an
entry in the ComboBox. Any time you are sitting on an existing record and make
an entry in a bound ComboBox you are changing the entry in the current record.
It is no different than typing over an existing value in a TextBox.

Did you use the wizard to create you ComboBox? The wizard provides choices for
either data entry or form navigation. If you choose the latter and then
manually bind the ComboBox to a field afterwards you could end up with a real
mess.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2

P: n/a

Hi Rick,

Hmm... I didnt know that (I just started to program!)
But I would think there should be a way to make a new record trough a
combo box.

Something like: first check if the name typed in de box is in the list:
if not then new record.

But if its totaly not possible then I will have to work with a button to
add new record...

Thanx for taking the time to teach me something ;)
Bye,
Xiphias

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

P: n/a
Hi,

Now I made 2 extra buttons next to the drop box (thats setup for
navigation ).
1button to edit and one to add new record. This happens in a 2nd form.
This works ok now(thanx again for your explenation).

Only when I close the 2nd form the drop box doesn't update. So I cant find
my new record.
I already tried with requery, but that makes no difference (or I'm doing
something wrong)
Most beautiful would be that the new added record would show when I close
the 2nd form.

And there is one other thing that I want to change, but I don't know how.
When I open my form the drop box is empty, but the rest of the for is
showing the first record.

Hope you have the time and patience to help me a little further.
Xiphias

Nov 12 '05 #4

P: n/a

"Xiphias" <Am*******@yahoo.com> wrote in message
news:40***********************@news.euronet.nl...
Hi,

Now I made 2 extra buttons next to the drop box (thats setup for
navigation ).
1button to edit and one to add new record. This happens in a 2nd form.
This works ok now(thanx again for your explenation).

Only when I close the 2nd form the drop box doesn't update. So I cant find
my new record.
I already tried with requery, but that makes no difference (or I'm doing
something wrong)
Most beautiful would be that the new added record would show when I close
the 2nd form.

And there is one other thing that I want to change, but I don't know how.
When I open my form the drop box is empty, but the rest of the for is
showing the first record.


In the close event of the second form...

Forms!NameOfFirstForm!NameOfComboBox.Requery
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #5

P: n/a
Rick,

Thank you very much!!!
"Rick Brandt" <ri*********@hotmail.com> schreef in bericht
news:bt************@ID-98015.news.uni-berlin.de...

"Xiphias" <Am*******@yahoo.com> wrote in message
news:40***********************@news.euronet.nl...
Hi,

Now I made 2 extra buttons next to the drop box (thats setup for
navigation ).
1button to edit and one to add new record. This happens in a 2nd form.
This works ok now(thanx again for your explenation).

Only when I close the 2nd form the drop box doesn't update. So I cant find my new record.
I already tried with requery, but that makes no difference (or I'm doing
something wrong)
Most beautiful would be that the new added record would show when I close the 2nd form.

And there is one other thing that I want to change, but I don't know how. When I open my form the drop box is empty, but the rest of the for is
showing the first record.


In the close event of the second form...

Forms!NameOfFirstForm!NameOfComboBox.Requery
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.