dbTalk Databases Forums  

Create many records from 1 form entry?

comp.databases.ms-access comp.databases.ms-access


Discuss Create many records from 1 form entry? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert Jacobs
 
Posts: n/a

Default Create many records from 1 form entry? - 07-16-2010 , 03:08 PM






First off, thank you any experts who have the answer to my final
question! I'm almost done with this thing! My database holds all of
our assets, and all of our software (boxed and open licenses).

Each piece of software needs this info: (no record can have the same
CD Key AND the same License Instance - one or the other can match,
just not both)
Product Name (i.e. Microsoft Office 2010)
CD Key
License Instance (i.e. 1 of 120, 2 of 120, etc.)
Computer Assigned to

All of this works... BUT, what I need is the capability to create
multiple records from one entry into a form. The way my DB works, you
have to enter all licenses as individual records, no matter how many
instances you have.

For example: I go out and purchase 120 open licenses of Microsoft
Office Professional 2010, all with the same Product Name and CD key,
and the Computer assigned to can be empty when first setup (can be
assigned later) - but the instance needs to change from 1 of 120, 2 of
120, 3 of 120... etc. Is there any way to create a form, where you
enter the Product Name and CD Key and the number of licenses you
purchased (i.e. 120), and it creates 120 records with the License
Instance automatically set to 1 of 120, 2 of 120, etc.?

God, I know this is confusing, but if it can be accomplished, it would
be GREATLY appreciated. I know I will get people asking why I set my
DB up this way, and trust me, I tried other ways, this is just what
works best for our particular scenario. In fact, if there is no way
to do this, it is still worth my time to enter them all in 1 at a
time... I just don't want to. I have other posts on other sites
asking about other ways to do these licenses to work the way I need it
to, and it just keeps coming back to this is the best route. Please
don't try to fix that problem, please try to give a solution to the
one I entered above. AGAIN - YOU ARE THE GREATEST, WHOEVER YOU ARE
THAT FIXES THIS FOR ME!!!!!

Reply With Quote
  #2  
Old   
XPS35
 
Posts: n/a

Default Re: Create many records from 1 form entry? - 07-16-2010 , 03:37 PM






Robert Jacobs wrote:

Quote:
First off, thank you any experts who have the answer to my final
question! I'm almost done with this thing! My database holds all of
our assets, and all of our software (boxed and open licenses).

Each piece of software needs this info: (no record can have the same
CD Key AND the same License Instance - one or the other can match,
just not both)
Product Name (i.e. Microsoft Office 2010)
CD Key
License Instance (i.e. 1 of 120, 2 of 120, etc.)
Computer Assigned to

All of this works... BUT, what I need is the capability to create
multiple records from one entry into a form. The way my DB works, you
have to enter all licenses as individual records, no matter how many
instances you have.

For example: I go out and purchase 120 open licenses of Microsoft
Office Professional 2010, all with the same Product Name and CD key,
and the Computer assigned to can be empty when first setup (can be
assigned later) - but the instance needs to change from 1 of 120, 2 of
120, 3 of 120... etc. Is there any way to create a form, where you
enter the Product Name and CD Key and the number of licenses you
purchased (i.e. 120), and it creates 120 records with the License
Instance automatically set to 1 of 120, 2 of 120, etc.?

God, I know this is confusing, but if it can be accomplished, it would
be GREATLY appreciated. I know I will get people asking why I set my
DB up this way, and trust me, I tried other ways, this is just what
works best for our particular scenario. In fact, if there is no way
to do this, it is still worth my time to enter them all in 1 at a
time... I just don't want to. I have other posts on other sites
asking about other ways to do these licenses to work the way I need it
to, and it just keeps coming back to this is the best route. Please
don't try to fix that problem, please try to give a solution to the
one I entered above. AGAIN - YOU ARE THE GREATEST, WHOEVER YOU ARE
THAT FIXES THIS FOR ME!!!!!
Create an unbound form with 3 fields(txtProduct, txtKey and numLicenses)
plus a commandbutton. For this button make a code like:

Dim LicCount As Integer

For LicCount = 1 To Me.numLicenses
DoCmd.RunSQL "INSERT INTO YourTable ([Product Name], [CD Key],
[License Instance]) " & _
"VALUES('" & Me.txtProduct & "','" & Me.txtKey & "','" &
LicCount & " of " & Me.numLicenses & "')"
Next

--
Groeten,

Peter
http://access.xps350.com


--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---

Reply With Quote
  #3  
Old   
Robert Jacobs
 
Posts: n/a

Default Re: Create many records from 1 form entry? - 07-16-2010 , 04:39 PM



On Jul 16, 3:37*pm, XPS35 <xps... (AT) gmail (DOT) com> wrote:
Quote:
Robert Jacobs wrote:
First off, thank you any experts who have the answer to my final
question! *I'm almost done with this thing! *My database holds all of
our assets, and all of our software (boxed and open licenses).

Each piece of software needs this info: (no record can have the same
CD Key AND the same License Instance - one or the other can match,
just not both)
* Product Name (i.e. Microsoft Office 2010)
* CD Key
* License Instance (i.e. 1 of 120, 2 of 120, etc.)
* Computer Assigned to

All of this works... BUT, what I need is the capability to create
multiple records from one entry into a form. *The way my DB works, you
have to enter all licenses as individual records, no matter how many
instances you have.

For example: *I go out and purchase 120 open licenses of Microsoft
Office Professional 2010, all with the same Product Name and CD key,
and the Computer assigned to can be empty when first setup (can be
assigned later) - but the instance needs to change from 1 of 120, 2 of
120, 3 of 120... etc. *Is there any way to create a form, where you
enter the Product Name and CD Key and the number of licenses you
purchased (i.e. 120), and it creates 120 records with the License
Instance automatically set to 1 of 120, 2 of 120, etc.?

God, I know this is confusing, but if it can be accomplished, it would
be GREATLY appreciated. *I know I will get people asking why I set my
DB up this way, and trust me, I tried other ways, this is just what
works best for our particular scenario. *In fact, if there is no way
to do this, it is still worth my time to enter them all in 1 at a
time... I just don't want to. *I have other posts on other sites
asking about other ways to do these licenses to work the way I need it
to, and it just keeps coming back to this is the best route. *Please
don't try to fix that problem, please try to give a solution to the
one I entered above. *AGAIN - YOU ARE THE GREATEST, WHOEVER YOU ARE
THAT FIXES THIS FOR ME!!!!!

Create an unbound form with 3 fields(txtProduct, txtKey and numLicenses)
plus a commandbutton. For this button make a code like:

Dim LicCount As Integer

For LicCount = 1 To Me.numLicenses
* * DoCmd.RunSQL "INSERT INTO YourTable ([Product Name], [CD Key],
[License Instance]) " & _
* * * * "VALUES('" & Me.txtProduct & "','" & Me.txtKey & "','" &
LicCount & " of " & Me.numLicenses & "')"
Next

--
Groeten,

Peterhttp://access.xps350.com

--- news://freenews.netfront.net/ - complaints: n... (AT) netfront (DOT) net ---
That worked perfectly! The only annoying part about it is that it
prompts you all 120 times if you want to append 1 record to your
table, and you have to click yes 120 times. Do you know of a way to
skip that message (or default the answer to yes for each message)? If
not - I don't really care - you just made my week! Thanks a ton
Peter!!!!!

Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: Create many records from 1 form entry? - 07-16-2010 , 04:41 PM



Robert Jacobs wrote:
Quote:
On Jul 16, 3:37 pm, XPS35 <xps... (AT) gmail (DOT) com> wrote:

Robert Jacobs wrote:

First off, thank you any experts who have the answer to my final
question! I'm almost done with this thing! My database holds all of
our assets, and all of our software (boxed and open licenses).

Each piece of software needs this info: (no record can have the same
CD Key AND the same License Instance - one or the other can match,
just not both)
Product Name (i.e. Microsoft Office 2010)
CD Key
License Instance (i.e. 1 of 120, 2 of 120, etc.)
Computer Assigned to

All of this works... BUT, what I need is the capability to create
multiple records from one entry into a form. The way my DB works, you
have to enter all licenses as individual records, no matter how many
instances you have.

For example: I go out and purchase 120 open licenses of Microsoft
Office Professional 2010, all with the same Product Name and CD key,
and the Computer assigned to can be empty when first setup (can be
assigned later) - but the instance needs to change from 1 of 120, 2 of
120, 3 of 120... etc. Is there any way to create a form, where you
enter the Product Name and CD Key and the number of licenses you
purchased (i.e. 120), and it creates 120 records with the License
Instance automatically set to 1 of 120, 2 of 120, etc.?

God, I know this is confusing, but if it can be accomplished, it would
be GREATLY appreciated. I know I will get people asking why I set my
DB up this way, and trust me, I tried other ways, this is just what
works best for our particular scenario. In fact, if there is no way
to do this, it is still worth my time to enter them all in 1 at a
time... I just don't want to. I have other posts on other sites
asking about other ways to do these licenses to work the way I need it
to, and it just keeps coming back to this is the best route. Please
don't try to fix that problem, please try to give a solution to the
one I entered above. AGAIN - YOU ARE THE GREATEST, WHOEVER YOU ARE
THAT FIXES THIS FOR ME!!!!!

Create an unbound form with 3 fields(txtProduct, txtKey and numLicenses)
plus a commandbutton. For this button make a code like:

Dim LicCount As Integer

For LicCount = 1 To Me.numLicenses
DoCmd.RunSQL "INSERT INTO YourTable ([Product Name], [CD Key],
[License Instance]) " & _
"VALUES('" & Me.txtProduct & "','" & Me.txtKey & "','" &
LicCount & " of " & Me.numLicenses & "')"
Next

--
Groeten,

Peterhttp://access.xps350.com

--- news://freenews.netfront.net/ - complaints: n... (AT) netfront (DOT) net ---


That worked perfectly! The only annoying part about it is that it
prompts you all 120 times if you want to append 1 record to your
table, and you have to click yes 120 times. Do you know of a way to
skip that message (or default the answer to yes for each message)? If
not - I don't really care - you just made my week! Thanks a ton
Peter!!!!!
Docmd.setwarnings false
....statements
docmd.setwarnings true

Reply With Quote
  #5  
Old   
paii, Ron
 
Posts: n/a

Default Re: Create many records from 1 form entry? - 07-19-2010 , 07:21 AM



"Robert Jacobs" <robertjacobsit (AT) gmail (DOT) com> wrote

On Jul 16, 3:37 pm, XPS35 <xps... (AT) gmail (DOT) com> wrote:
Quote:
Robert Jacobs wrote:
First off, thank you any experts who have the answer to my final
question! I'm almost done with this thing! My database holds all of
our assets, and all of our software (boxed and open licenses).

Each piece of software needs this info: (no record can have the same
CD Key AND the same License Instance - one or the other can match,
just not both)
Product Name (i.e. Microsoft Office 2010)
CD Key
License Instance (i.e. 1 of 120, 2 of 120, etc.)
Computer Assigned to

All of this works... BUT, what I need is the capability to create
multiple records from one entry into a form. The way my DB works, you
have to enter all licenses as individual records, no matter how many
instances you have.

For example: I go out and purchase 120 open licenses of Microsoft
Office Professional 2010, all with the same Product Name and CD key,
and the Computer assigned to can be empty when first setup (can be
assigned later) - but the instance needs to change from 1 of 120, 2 of
120, 3 of 120... etc. Is there any way to create a form, where you
enter the Product Name and CD Key and the number of licenses you
purchased (i.e. 120), and it creates 120 records with the License
Instance automatically set to 1 of 120, 2 of 120, etc.?

God, I know this is confusing, but if it can be accomplished, it would
be GREATLY appreciated. I know I will get people asking why I set my
DB up this way, and trust me, I tried other ways, this is just what
works best for our particular scenario. In fact, if there is no way
to do this, it is still worth my time to enter them all in 1 at a
time... I just don't want to. I have other posts on other sites
asking about other ways to do these licenses to work the way I need it
to, and it just keeps coming back to this is the best route. Please
don't try to fix that problem, please try to give a solution to the
one I entered above. AGAIN - YOU ARE THE GREATEST, WHOEVER YOU ARE
THAT FIXES THIS FOR ME!!!!!

Create an unbound form with 3 fields(txtProduct, txtKey and numLicenses)
plus a commandbutton. For this button make a code like:

Dim LicCount As Integer

For LicCount = 1 To Me.numLicenses
DoCmd.RunSQL "INSERT INTO YourTable ([Product Name], [CD Key],
[License Instance]) " & _
"VALUES('" & Me.txtProduct & "','" & Me.txtKey & "','" &
LicCount & " of " & Me.numLicenses & "')"
Next

--
Groeten,

Peterhttp://access.xps350.com

--- news://freenews.netfront.net/ - complaints: n... (AT) netfront (DOT) net ---

That worked perfectly! The only annoying part about it is that it
prompts you all 120 times if you want to append 1 record to your
table, and you have to click yes 120 times. Do you know of a way to
skip that message (or default the answer to yes for each message)? If
not - I don't really care - you just made my week! Thanks a ton
Peter!!!!!
Use Execute instead of RunSQL

dim db as Database
Set db = currentdb
For LicCount = 1 To Me.numLicenses
db.execute "INSERT INTO YourTable ([Product Name], [CD Key],
[License Instance]) " & _
"VALUES('" & Me.txtProduct & "','" & Me.txtKey & "','" &
LicCount & " of " & Me.numLicenses & "')"
Next
set db = nothing

Reply With Quote
  #6  
Old   
Robert Jacobs
 
Posts: n/a

Default Re: Create many records from 1 form entry? - 07-19-2010 , 09:10 AM



On Jul 19, 7:21*am, "paii, Ron" <n... (AT) no (DOT) com> wrote:
Quote:
"Robert Jacobs" <robertjacob... (AT) gmail (DOT) com> wrote in message

news:ffb50bf5-8108-45df-80ca-374a7dc6f7b9 (AT) b35g2000yqi (DOT) googlegroups.com...
On Jul 16, 3:37 pm, XPS35 <xps... (AT) gmail (DOT) com> wrote:



Robert Jacobs wrote:
First off, thank you any experts who have the answer to my final
question! I'm almost done with this thing! My database holds all of
our assets, and all of our software (boxed and open licenses).

Each piece of software needs this info: (no record can have the same
CD Key AND the same License Instance - one or the other can match,
just not both)
Product Name (i.e. Microsoft Office 2010)
CD Key
License Instance (i.e. 1 of 120, 2 of 120, etc.)
Computer Assigned to

All of this works... BUT, what I need is the capability to create
multiple records from one entry into a form. The way my DB works, you
have to enter all licenses as individual records, no matter how many
instances you have.

For example: I go out and purchase 120 open licenses of Microsoft
Office Professional 2010, all with the same Product Name and CD key,
and the Computer assigned to can be empty when first setup (can be
assigned later) - but the instance needs to change from 1 of 120, 2 of
120, 3 of 120... etc. Is there any way to create a form, where you
enter the Product Name and CD Key and the number of licenses you
purchased (i.e. 120), and it creates 120 records with the License
Instance automatically set to 1 of 120, 2 of 120, etc.?

God, I know this is confusing, but if it can be accomplished, it would
be GREATLY appreciated. I know I will get people asking why I set my
DB up this way, and trust me, I tried other ways, this is just what
works best for our particular scenario. In fact, if there is no way
to do this, it is still worth my time to enter them all in 1 at a
time... I just don't want to. I have other posts on other sites
asking about other ways to do these licenses to work the way I need it
to, and it just keeps coming back to this is the best route. Please
don't try to fix that problem, please try to give a solution to the
one I entered above. AGAIN - YOU ARE THE GREATEST, WHOEVER YOU ARE
THAT FIXES THIS FOR ME!!!!!

Create an unbound form with 3 fields(txtProduct, txtKey and numLicenses)
plus a commandbutton. For this button make a code like:

Dim LicCount As Integer

For LicCount = 1 To Me.numLicenses
DoCmd.RunSQL "INSERT INTO YourTable ([Product Name], [CD Key],
[License Instance]) " & _
"VALUES('" & Me.txtProduct & "','" & Me.txtKey & "','" &
LicCount & " of " & Me.numLicenses & "')"
Next

--
Groeten,

Peterhttp://access.xps350.com

--- news://freenews.netfront.net/ - complaints: n... (AT) netfront (DOT) net ---
That worked perfectly! *The only annoying part about it is that it
prompts you all 120 times if you want to append 1 record to your
table, and you have to click yes 120 times. *Do you know of a way to
skip that message (or default the answer to yes for each message)? *If
not - I don't really care - you just made my week! *Thanks a ton
Peter!!!!!

Use Execute instead of RunSQL

dim db as Database
Set db = currentdb
*For LicCount = 1 To Me.numLicenses
*db.execute "INSERT INTO YourTable ([Product Name], [CD Key],
*[License Instance]) " & _
*"VALUES('" & Me.txtProduct & "','" & Me.txtKey & "','" &
*LicCount & " of " & Me.numLicenses & "')"
*Next
set db = nothing


Awesome awesome awesome. Thank you to everybody - XPS35 - your code
worked perfectly... Salad, your suggestion on replying to the
message worked perfectly as well. Ron, I used your code as it seemed
to work a bit faster and with less quirkiness than answering each
message with true or false. Again, all around... awesome! Thanks
guys!

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.