RE: How to enter data into a table using a combobox

From: A. (A._at_discussions.microsoft.com)
Date: 11/29/04


Date: Mon, 29 Nov 2004 12:27:03 -0800


 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:

> For 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:
>
> > Thanks,
> > 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:
> >
> > > Katy,
> > > 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:
> > >
> > > > I'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:
> > > >
> > > > > Katy,
> > > > > 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:
> > > > >
> > > > > > 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
> > > > > >
> > > > > > "Dana809904" wrote:
> > > > > >
> > > > > > > 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.mvps.org/access/forms/frm0015.htm
> > > > > > > Hopefully that will work! Let me know if you still have problems! :)
> > > > > > > ~Dana
> > > > > > >
> > > > > > > "wilsonk" wrote:
> > > > > > >
> > > > > > > > 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
> > > > > > > >
> > > > > > > > "Dana809904" wrote:
> > > > > > > >
> > > > > > > > > You should check out this link: http://www.mvps.org/access/forms/frm0015.htm
> > > > > > > > > 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
> > > > > > > > >
> > > > > > > > > "wilsonkaty" wrote:
> > > > > > > > >
> > > > > > > > > > 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



Relevant Pages

  • Re: search component using picture alternative text
    ... Its doesn't take luck. ... Here's a tidbit...put HTML comments into the fields of your database ... preventing their display. ...
    (microsoft.public.frontpage.programming)
  • RE: Menubar Gone -- How to Recover It?
    ... LarryP -- I'll be watching posts to this problem with interest. ... and even created a new blank database and did likewise. ... in the registry somewhere or in her user profile that says when SHE launches ... Rightclick-Customize-Menubar-Reset, no luck. ...
    (microsoft.public.access.setupconfig)
  • Re: Sharepoint web site gone but database still intact
    ... I still have the config database and the content database in MSDE but the ... no luck, ... "Wayne Atkinson" wrote: ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: need a reply of this question
    ... You will have more luck getting your questions answered in the future if you ... make the subject of the post relevant to the question you have. ... the problem is in the code when i want to insert the selected data to a ...
    (microsoft.public.dotnet.framework.adonet)