PC Review


Reply
Thread Tools Rate Thread

custom INSERT INTO TABLE statement for ACCESS 2003

 
 
Belinda
Guest
Posts: n/a
 
      8th Jul 2009

I am trying to insert a "new" record into my table. I want to know how to
take the user input from the test fields on the form and combine them to
INSERT INTO MYTABLE. Currently the fields are bound to MYTABLE.
The user also wanted dropdown lists to minimize type errors so I created a
few “selectDistinctQueries” from MYTABLE to provide this functionality.
However, the lists are not allowing the selection, and/or new entries. LIMIT
TO LIST is NO.
Any help/code on these issues is welcome.

Thanks in advance, Belinda
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      9th Jul 2009

On Wed, 8 Jul 2009 15:01:01 -0700, Belinda <(E-Mail Removed)>
wrote:

>I am trying to insert a "new" record into my table. I want to know how to
>take the user input from the test fields on the form and combine them to
>INSERT INTO MYTABLE. Currently the fields are bound to MYTABLE.
>The user also wanted dropdown lists to minimize type errors so I created a
>few selectDistinctQueries from MYTABLE to provide this functionality.
>However, the lists are not allowing the selection, and/or new entries. LIMIT
>TO LIST is NO.
>Any help/code on these issues is welcome.
>
>Thanks in advance, Belinda


If you have a bound form, you should not need any code nor any append query! A
Form bound to a table lets you just type data; as soon as you move off the
record it saves it to disk.

What is your form's Recordsource property?
How about its Allow Additions and Allow Edits (both should be Yes)?
What are the RowSource properties of a couple of these combos? Post the SQL.
What specific error message are you getting?
--

John W. Vinson [MVP]
 
Reply With Quote
 
Belinda
Guest
Posts: n/a
 
      9th Jul 2009
Hi John
I hope I can answer this adequately…I’m new to this and I experimented with
trying to get custom distinct dropdown lists/menus so thier control source is
to the field names of the table, but the row source on them are from the
distinctQueries, and the row source types are Table/Query. The other fields
on the form that require unique input ( that is not like to be duplicated)
are listed as the regular control source, as the field names in the table
with no row source that I can see on the properties menu.
If I am going about this all wrong, just let me know ASAP. I really don’t
want to waste anymore time on this. I know that the last record can be made
to add a new record but I wanted a little more customization to this and
that’s why I wanted the drop down menus. In my own attempt to remedy this I
am in the process of combining all my selectDistinct Queries into a new query
in hope that I will them be able to create the form off that and then update
the table with the new record. Is that feasible? If you know of how to select
user text input to write the new record, please let me know the easiest,
fastest way, in terms a novice like me can grasp. Thanks a Million John!

-- Belinda


"John W. Vinson" wrote:

> On Wed, 8 Jul 2009 15:01:01 -0700, Belinda <(E-Mail Removed)>
> wrote:
>
> >I am trying to insert a "new" record into my table. I want to know how to
> >take the user input from the test fields on the form and combine them to
> >INSERT INTO MYTABLE. Currently the fields are bound to MYTABLE.
> >The user also wanted dropdown lists to minimize type errors so I created a
> >few “selectDistinctQueries” from MYTABLE to provide this functionality.
> >However, the lists are not allowing the selection, and/or new entries. LIMIT
> >TO LIST is NO.
> >Any help/code on these issues is welcome.
> >
> >Thanks in advance, Belinda

>
> If you have a bound form, you should not need any code nor any append query! A
> Form bound to a table lets you just type data; as soon as you move off the
> record it saves it to disk.
>
> What is your form's Recordsource property?
> How about its Allow Additions and Allow Edits (both should be Yes)?
> What are the RowSource properties of a couple of these combos? Post the SQL.
> What specific error message are you getting?
> --
>
> John W. Vinson [MVP]
>

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      9th Jul 2009

On Thu, 9 Jul 2009 07:12:01 -0700, Belinda <(E-Mail Removed)>
wrote:

>Hi John
>I hope I can answer this adequatelyIm new to this and I experimented with
>trying to get custom distinct dropdown lists/menus so thier control source is
>to the field names of the table, but the row source on them are from the
>distinctQueries, and the row source types are Table/Query. The other fields
>on the form that require unique input ( that is not like to be duplicated)
>are listed as the regular control source, as the field names in the table
>with no row source that I can see on the properties menu.


If a field isn't being selected from a list (either a list of values or a
query/table) and instead just being typed in, your form should use a Textbox
control bound to the table field, not a combo box. Otherwise you're doing
fine.

>If I am going about this all wrong, just let me know ASAP. I really dont
>want to waste anymore time on this. I know that the last record can be made
>to add a new record but I wanted a little more customization to this and
>thats why I wanted the drop down menus. In my own attempt to remedy this I
>am in the process of combining all my selectDistinct Queries into a new query
>in hope that I will them be able to create the form off that and then update
>the table with the new record. Is that feasible? If you know of how to select
>user text input to write the new record, please let me know the easiest,
>fastest way, in terms a novice like me can grasp. Thanks a Million John!


You're making a simple job very much more difficult!

You don't need ANY CODE AT ALL.
You don't need to append records to the table.
You don't need to combine your queries.

Access does all of this *FOR YOU AUTOMATICALLY*.

A bound form... adds records to the table. All by itself, with no programming
needed from you.

Take a look at Crystal's video or one of the other tutorials here and start
from scratch. It's not as hard as you're making it!
Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/acc...resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

Roger Carlson's tutorials, samples and tips:
http://www.rogersaccesslibrary.com/

A free tutorial written by Crystal:
http://allenbrowne.com/casu-22.html

A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials

--

John W. Vinson [MVP]
 
Reply With Quote
 
Belinda
Guest
Posts: n/a
 
      9th Jul 2009
John
It'll take me a time to look through the resources you referenced. Thank you
very much! I'll let you know how I do...
--
Many thanks, Belinda


"John W. Vinson" wrote:

> On Thu, 9 Jul 2009 07:12:01 -0700, Belinda <(E-Mail Removed)>
> wrote:
>
>
> You're making a simple job very much more difficult!
>
> You don't need ANY CODE AT ALL.
> You don't need to append records to the table.
> You don't need to combine your queries.
>
> Access does all of this *FOR YOU AUTOMATICALLY*.
>
> A bound form... adds records to the table. All by itself, with no programming
> needed from you.
>
> Take a look at Crystal's video or one of the other tutorials here and start
> from scratch. It's not as hard as you're making it!
> Jeff Conrad's resources page:
> http://www.accessmvp.com/JConrad/acc...resources.html
>
> The Access Web resources page:
> http://www.mvps.org/access/resources/index.html
>
> Roger Carlson's tutorials, samples and tips:
> http://www.rogersaccesslibrary.com/
>
> A free tutorial written by Crystal:
> http://allenbrowne.com/casu-22.html
>
> A video how-to series by Crystal:
> http://www.YouTube.com/user/LearnAccessByCrystal
>
> MVP Allen Browne's tutorials:
> http://allenbrowne.com/links.html#Tutorials
>
> --
>
> John W. Vinson [MVP]
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pless I want to insert image in my table Access 2003 and preview doaasadek Microsoft Access Forms 1 17th Jun 2009 01:53 PM
How to insert a bmp file into Access 2003 table using code Access Newbie Microsoft Access VBA Modules 2 24th Apr 2009 01:59 PM
Using a SQL 'INSERT INTO' statement with a table having an AutoNumber Field Jack G Microsoft Access Getting Started 12 23rd May 2006 04:15 PM
Insert statement not updating table? Pamela via AccessMonster.com Microsoft Access Form Coding 7 12th Aug 2005 07:51 PM
SQL Insert statement with a custom function Chris Guld Microsoft Access Form Coding 1 20th May 2004 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:25 PM.