473,405 Members | 2,279 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,405 software developers and data experts.

drop box doesnt ad new record?

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
5 2028
"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

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
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Dan | last post by:
Hello all, I am getting records from a db and displaying the records to the user through a drop down menu in an asp page. Each record has 6 fields and I need to display them all to the user in...
1
by: Adonis Walmsley-McCarthy | last post by:
Hello all, Does anyone know how to use drag n drop techniques/command button to change the order that records will be displayed on a form? To illustrate, suppose I have 3 records a,b,c stored...
14
by: deko | last post by:
Can the DROP TABLE statement be used with a select or where statement? DROP TABLE SELECT * FROM tblTablesImported WHERE Import_ID Not In (SELECT FROM tblTablesInternal); Or do I have to...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
0
by: kaon | last post by:
Hi, Ive been looking for a way to capture an autopostback event of a dropdownlist in a datagrid control. the scenario is that, ive a datagrid, and there is a dropdownlist column in each of the row...
0
by: dutone | last post by:
I have searched high and low for a solution to this and I dont think its possible.... but I hope not. What I have is a list of items with various values that can be changed via a drop down. Each...
2
by: Krustov | last post by:
If you double click on a empty form box a drop down menu will appear . But if the form box has text content - then double clicking on the form box has no effect and a drop down menu doesnt appear...
1
by: ninja | last post by:
Hi I am new to PHP and I have a little problem I have created a user registration form and on this form I have three drop downs one for title, prov/state and country. This creates a record in the...
1
by: lydialysol | last post by:
I don't have any issues creating drop down menus utilizing PHP and Mysql or posting that information back to the database. My issues comes when I retrieve the records for updating purposes. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.