How to enter data into a table using a combobox

How to enter data into a table using a combobox

Post by d2lsc29ua2 » Sat, 25 Sep 2004 03:35:06


I've tried to learn for months how to set up the properties in fields in my
forms to enter data directly into a table by typing it into a combo box.
I've tried changing the "limit to list" option to "no" but consistently I
come up with the primary key number on all of the fields in the forms instead
of the actual data. I have tried to adjust the "bound to column" option to
another number with no results. I understand from much investigatin that I
need to write a code in a macro or module, but that is beyond my level of
expertise. Can anyone help me?

Thanks
 
 
 

How to enter data into a table using a combobox

Post by RGFuYTgwOT » Sat, 25 Sep 2004 12:55:02

You should check out this link: http://www.yqcomputer.com/
It is pretty much right down the line of what you're looking for I believe.
It does limit you to entering only the one value you type in the comboBox
that would perform the lookup of other records. It may be possible to input
multiple values into a new record if you could somehow break up the NewData
string variable in the NotInLIst event. You can also avoid using the primary
key number by setting the width of that first element to 0" in the
properties, or dragging it all the way to the left in the comboBox creation
wizard. Then you can use the value of the second column instead.
Hope this helps!
~Dana S

 
 
 

How to enter data into a table using a combobox

Post by d2lsc29ua » Tue, 28 Sep 2004 23:17:05

Thanks, this looks like something that will help me. I'd like very much to
bring up the link you gave me, but it comes up each time as invalid. Could
you check it and see if you typed it in correctly?

Thanks,
Katy
 
 
 

How to enter data into a table using a combobox

Post by RGFuYTgwOT » Wed, 29 Sep 2004 04:25:03

Hello,
It looks like when I posted the link a space was added to the end of the url
and for some reason that was causing the invalid page error. So try entering
it again: http://www.yqcomputer.com/
Hopefully that will work! Let me know if you still have problems! :)
~Dana
 
 
 

How to enter data into a table using a combobox

Post by d2lsc29ua » Wed, 29 Sep 2004 04:49:05

That came through fine and looks just what I need. I hate to ask
kindergarden questions in university, but since I'm so new at this, could you
tell me where to insert the name of my database in this module example?
Thanks so much.
Katy
 
 
 

How to enter data into a table using a combobox

Post by RGFuYTgwOT » Wed, 29 Sep 2004 05:35:04

aty,
No worries about asking simple questions... in my eyes that is the purpose
of these forums, to help the pros down to the beginners.. we all have to
start somewhere! :)
So I am pretty sure that there is no need to include the name of the
database as the command: "Set db = CurrentDb" automatically assigns the db
database object to the database where the module resides. Unless your
project deals with multiple databases (in that case it would be out of my
knowledge), you shouldn't have to deal with the database name at all. Please
let me know if this sounds confusing or doesn't clear up your question!
Good luck,
Dana

"wilsonk" wrote:

 
 
 

How to enter data into a table using a combobox

Post by d2lsc29ua » Wed, 29 Sep 2004 05:41:04

'll give this a try tomorrow when my mind is fresh and will let you know how
it works. Thanks again for your time and help.

Katy

"Dana809904" wrote:

 
 
 

How to enter data into a table using a combobox

Post by RGFuYTgwOT » Thu, 30 Sep 2004 01:13:01

aty,
While you're mind is fresh you might also want to check out this link:
http://members.iinet.net.au/~allenbrowne/ser-27.html
It is another way of doing the NotInList thing. :) I am not sure if it has
more limitations or advantages yet though. Going to check that out today.
Have a good one,
Dana

"wilsonk" wrote:

 
 
 

How to enter data into a table using a combobox

Post by d2lsc29ua » Thu, 30 Sep 2004 05:03:03

hanks,
I haven't had much time to work on it today, but first thing this a.m. I
copied the module from the first web page and pasted into the Code Builder in
the "Not in List" event. It didn't work. I haven't had time to see if I
could de-bug it. It may be because I'm using Access 2005 and some of the
expressions are different. I get several messages from the Access gurus that
I can't interpret. I'll try the other webpage tomorrow and see if I have
more luck. If not, and if your patience doesn't wear out, we may talk again.

Thanks again for your help.

Katy

"Dana809904" wrote:

 
 
 

How to enter data into a table using a combobox

Post by RGFuYTgwOT » Thu, 30 Sep 2004 05:11:06

or that first code example I sent you, there are two things that need to be
customized for your database, I should've pointed them out to you when I said
you don't need to mess with the database name.
1: Table name; e.g. Set rs = db.OpenRecordset("tblAE", dbOpenDynaset) ;
Replace "tblAE" with the table name that will be added to.
2: Field name; e.g. rs!AEName = NewData ; Replace AEName with the field name
where you will insert your data.
After this the code should work correctly. (Fingers crossed :)
Good luck,
Dana

"wilsonk" wrote:

 
 
 

How to enter data into a table using a combobox

Post by d2lsc29ua » Thu, 30 Sep 2004 05:15:31

hanks,
I'll try that tomorrow also.

Katy

"Dana809904" wrote:

 
 
 

How to enter data into a table using a combobox

Post by QS4 » Wed, 01 Dec 2004 05:27:03

Hi,
I am having some issues with the NotInList function. I've changed the table
name and field name, but continue to get errors. Can you help please?

For the db As ADODB.Database line I get "User-defined type not defined". If
I comment out this line, it gets as far as prompting me to Add the new data
to my table but then I get another error: "Invalid Argurment". It's for Set
rs = db.OpenRecordset("tblIssueDescr", dbOpenDynaset) line.

Any Ideas??

"Dana809904" wrote:

 
 
 

How to enter data into a table using a combobox

Post by RGFu » Thu, 02 Jun 2005 01:04:29

'm having the same problem as A. later in the thread. I've done everything
suggested but NG. I'm running Access2002. Any help appreciated....

"Dana809904" wrote: