Adding Multiple Records


I am attempting to add multiple records to a table from a command
button. All but one of the fields will be the same for each record. I
have checkboxes with user names, and I'd like to add a record for each
user that is checked. The form is unbound - with textboxes that will
hold the standard information for each record. I just need to add
separate records based on whether the user's checkbox is checked...

if chkbox.value = -1 then
  docmd.runsql "insert into..."

I'm having trouble setting up the loop and/or recordset. Any guidance
is greatly appreciated.

3/14/2008 5:06:16 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 41

Name your check boxes 'chk1','chk2', etc.  In the tag property for each box, 
store the name of the person that the check box is for. Then you can use 
something like the following code to loop through them. Note: I have used 
this successfully for combo boxes, but never for check boxes. It should still 

Dim intCurBox as integer

For intCurrentBox = 1 To << how ever many boxes you have>>
      If Me("chk" & intCurBox).Value = -1 Then
         << do something here; use Me("chk" & intCurBox).Tag to get the name 
of  the person>>
      End If
Next intCurrentBox

"SDCT" wrote:

> Hi,
> I am attempting to add multiple records to a table from a command
> button. All but one of the fields will be the same for each record. I
> have checkboxes with user names, and I'd like to add a record for each
> user that is checked. The form is unbound - with textboxes that will
> hold the standard information for each record. I just need to add
> separate records based on whether the user's checkbox is checked...
> if chkbox.value = -1 then
>   docmd.runsql "insert into..."
> I'm having trouble setting up the loop and/or recordset. Any guidance
> is greatly appreciated.
> Thanks
3/14/2008 5:57:00 PM
Thanks a lot.... a much simpler approach than I expected, and it does
exactly what I need it to do!!! Much appreciated!!!
3/14/2008 7:07:58 PM

Similar Artilces:

Deserialize an XML file with multiple namespaces...
Hopefully I can ask this question without regaling you kind people in too many gory details. Here's what I'm trying to do: - I have a local XML file with a .GPX extension which I downloaded from - The file contains a bunch of elements called <WPT> - Within the WPT elements are a number of other elements <time>, <sym>, <groundspeak:name>... - The non-qualified elements come from a schema/namespace at - The qualified elements come from a schema/namespace at - I ran xsd.exe with th...

problem with multiple SMTP domains in Exchange Server 2003
Hi there I have added a second SMTP domain to the Email Addresses (Policy) as follows: Recipients > Recipient Policies > Default Policy > Email Addresses (Policy) > New ... > SMTP Address > > (checked) This Exchange Organization is responsible for all mail delivery > to this address > Apply. When I do so, I no longer receive external emails on the first SMTP domain ( Is this related to relay settings, or perhaps something else? Best regards Loane ...

Multiple Sessions of Outlook
Is it possible to run multiple Outlook sessions at the same time with different profiles? sid. No. -- Patricia Cardoza Outlook MVP Author, Special Edition Using Microsoft Outlook 2003 ***Please post all replies to the newsgroups*** "Sid" <> wrote in message news:c6b901c3b9ed$98ef8e90$a601280a@phx.gbl... > Is it possible to run multiple Outlook sessions at the > same time with different profiles? > > sid. ...

I want to build (1) report and have my Record Source be one of three queries based on a selection in an option box on a form. Can I do this? If so, do you have any coding that might get me started? OR Do I need to create three reports and use each query as the record source? Thanks If you have Access 2003 + you can use Reports!MyReportName.RecordSource = "MyQuery" where MyQuery is the name of the query you wish to change to. I don't know if it works with earlier versions. Evi "NEWER USER" <> wrote in message news:6C9AA...

Select multiple adjacent cells of multiple cells without selecting
Select multiple adjacent cells of multiple cells without selecting adjacent cells one by one. those cells looks like; |adjacent cells |cells| |some characters | A | |some characters | B | |some characters | A | |some characters | A | |some characters | B | I am trying to select adjacent cells of A cells without selecting adjacent cells one by one. Thank you for your help. Adjacent in this case, means? If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgr...

Remove records from lookup
Not sure if this is possible but I would like to remove all records except the account records from the look up records dropdown menu of the appointment entity. The associated schema is regardingobjectid and the label is regarding. I see the other entities listed under relationships but there is no option to delete. Is there a way to create a new lookup and have it added to my appointment form? Thanks. There is no supported way to change this. The system is setup to allow you to set appointments that are related to specific records (Opportunities, Quotes, Cases, etc) and it will then ro...

entering multiple costs for an item
I am very new to Retail Management, and am trying to enter inventory, and create a purchase order. I can't figure out how to enter various costs for the same item from the same supplier. For example, when we purchase in lots of 50 pcs., the item cost is .50 per item (total cost of 25.00). However, if we purchase in lots of 100 pcs, the item cost is .47 per item (total cost of 47.00). We can also purchase the item in boxes of 10 (5.50 per box for a cost of .55 per item). How can I enter these costs so when I place a purchase order, the cost will be correct according to the quant...

Pull Data From Multiple Tables ????
Hi I will have 4 tables name "TblCostomers","TblVendors","TblAccounts", TblExpenses" Now i have a for name "FrmDrVouchers" that has a table "TblDrVouchers" in source. This form has two TxtBox Control name "TxtAccountNo" and "TxtAccountName" If User enters a Account No., It pulls the Account Name from Any One of these Table. I can do this if I have only one table. But tell me how can i do it while I have 4 tables for One Field of a table Thank you.. -- Message posted via http://...

view multiple public calendars
We have seven public folders set up as calendar for room appointments. How can we view them side by side as shared calendars? The only way I can think of implementing this is to set up 7 user accounts and share their calendars. -- Posted via a free Usenet account from version of outlook? if 2003 or 2007, add them to the public folder favorites and they'll be in the calendar list. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? Outlook 2007: http://www.slipst...

ACCESS 2000 is deleting records
Just yesterday I converted an Access 97 database to Access 2000. Have a large problem I need help with. After converting the DB I "split it" in order to use it as a backend, same way it was in Access97. After converting the database to Access2k we began to have a problem with Access2k deleting records. it deleted a total of 4 out of 62 records. the records are not together ( record #289365 then 289048 then 289128 then 289178 then this morning 289405) these record are auto-numbered incerement of one. They were entered by different people so I know its not just an operator probl...

RMS--Multiple Loyalty Clubs
Does anyone make an add on to allow for multiple loyalty clubs per client? I would like to be able to set it up so that I can either print out a certificate every month and send the customer a voucher for their reward points for the particular club, or set it up so that certain levels of points trigger certificates for redemptions for certain SKUs of product vs. a flat cash credit to their account. contact me at secure payment systems for some really cool options regarding our loyalty card program that we are integrating with microsoft's retail management system right now. It's...

Viewing multiple excell spreadsheets on the task bar
Why is it that when I have 3 or more excell spreadsheets open they are not all listed on my task bar the only way I can get to them is by going to the window button and selecting the one I want to see, I want to be able to ALT TAB between them and they are not listing them for me in the task bar only the current one I have open? Are you using XP? Sounds like that feature of XP which groups several windows of one application into one spot on the task bar. There may be a way to shut this off in taskbar properties. Click on the task bar and select properties. "Megan" wrote: ...

Adding Fonts to New Font Collection
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I need help in adding a few of the fonts I commonly use to the Fonts Collection, which appears at the top of the Drop down menu under FONTS. I would like to store the names of a half dozen fonts in the Font Collection menu so that I can avoid scrolling through the entire Font list in order to highlight them. If one uses Verdana a lot, this is a real pain. Right now, when I go to Font Collections (under the Font menu), I see the subheading New Favorites, not no list appears when I click on it. I want to put my favo...

Programmatically adding function to copy all incoming mail to public folder (based on sender domain)
Hi all. I would like to be able to (from any client) execute a script (vbs, exe, whatever) that creates a public folder. That's should be pretty easy. The tricky part is that I want the same script to create a rule (?) on the Exchange server that copies all incoming mail from a specific sender domain to that new public folder. Hmm... Let us assume that I have the sufficient credentials for this action hardcoded in the script.. does anyone have a good idea how to do that. I am creating an interface in our ERP software that should be able to see mail correspondance horizontically accross ...

Adding Contact Person to SOP Other Invoice Form
We would like to add a field to the "Bill to" and "Ship to" addresses that is the "Contact Person" field from the Address ID palette. How do I do this? This is done easily, check out Knowledgebase Article 874176. You will need to add some additional calculated fields and then modify the existing calculated fields. Using the rw_SelectAddrLine user function you can add the following fields (for example) to an address and have it grow and shrink dynamically with no empty lines. Customer Name Contact Person Address1 Address2 Address3 City State Zip Country ...

Using multiple databases
I have three seperate databases - all do a differnt function using a seperate database that holds all the data in tables (i.e. one uses queries to export, one to import, one for reporting only) - and I want to keep all of the databases seperate. Can I create another database that just has a form that works as a dashboard and connect to the other three to do functions. Essentially, I want to be able to select an option to open reports, import data, or export data and do it without opening the other databases seperatly (a function that each database will perform on it's own w...

Print multiple tabs on one page
How to print multiple tabs in excel onto one page in one print job? Tab1 and tab2 have different format and cannot be combined into one tab. Need to print the two worksheets one on top of each other is the same direction. Tried Report Manager but printed on two pieces of paper. Any suggestions? One way to accomplish something like this is to play around with "pictures". I'm on an XL97 machine now so, When you hold down <Shift> and hit <Edit>, you get a different dialog box .... one that contains "picture " options. So, select an entire sheet, or p...

Printing a Purchase Order to Multiple Destinations
Is it possible to print a PO to a text file on the local machine or network in addition to the local default printer? -- Pete P. It is possible to print a text file to any single location you want in addition to the local default printer. Our system currently prompts users requesting this information. Giving them their choice of 3 formats: Screen Printer File These can be selected in any combination but only one destination per format can be specified. I am hoping that this thread will explain how/if one could deliver one printed report to multiple printers. Eventually I would lik...

Adding a space to a string
Hi i am trying to add a space i.e Column A1 " hello " Column B1 "mom" with column C1 reading "hello mom" at the moment it reads "hellomom" i know it maybe a simple question but new to this Paul Hi Paul In C1: =A1&" "&B1 HTH. best wishes Harald "lennymos123" <> skrev i melding > Hi i am trying to add a space i.e Column A1 " hello " Column B1 "mom" > with column C1 reading "hello mom" at the moment it rea...

Adding images to a checkedListBox
If I understood well, I can add not only text but also objects to a checkedListBox. So i'd like to add an image as item to my checkedListBox. I tried this: checkedListBox1.Items.Add(imageList1.Images[0]), but it adds "System.Drawing.Bitmap" instead of an image. I'm still pretty inexperienced with c#, so who can help me with this further. Jasmine ...

Can VISIO 2007 work on multiple pages of an org chart simultaneous
I created an org chart with over 100 pages using the Org Chart Wizard and Excel, I’m assigning colors to various shapes using the Data Graphic feature. To apply the colors I choose “Edit” then “select all” which selects all the shapes on the current sheet, then I select “Apply To Selected Shapes” from the Data Graphics pane, this works fine for the current sheet but is there a way to apply this to all the sheets at once. Thanks Mark, I've written a macro for you to try in my blog... See Applying Selected DataGraphic to the Whole Document -

Insert query with two left outer joins gives "Record is Deleted" m
Hi, I have built an insert query to combine data from 3 tables into one table based on a key value (RA_ID) on a form. Two of the from tables may or may not have data associated with the main from table. So I have coded the select from statement using left outer joins. When I run the query with a row in the first child table but not in the second it works fine but when I run the query with a key value that exists in the 2nd child table but not in the first I get a message saying "record is deleted". Anybody have any ideas what is causing this? Here is the query......... ...

Filter by multiple colors
In Excel 2007, I am trying to filter by two different colors. I can see how I can filter by just one color - can I filter by two colors? Thanks for your help, -- Michelle ...

Adding additional address lines on version 8
I am modifying the POP Blank Form on version 8 (never been modified before). I have modified the existing Vendor Address 1-3 within Calculated fields to add the Country (removing the last ""). I then create a vendor address 4, which is identical to 1-3 except for a number 4 for the line number. This is what I have done in all previous versions and it has worked fine. When I go to print I get an error "Max symbol length exceeded: Increase MAX_TOK_LEN." If I delete the new calculated field it prints fine. All our SOP reports have the 4 line, but were upgraded to ...

adding an option in the right click menu
Hallo, I would like to add the option "copyto notepad" when I right-click on any cell. Any suggestions how to do this, so the text in the cell will automatically be copied to notepad ? Thanks very much ! Kontiki Hi as starting point some code: Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) On Error Resume Next New_Entry.Controls("My message").Delete On Error Goto 0 With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message...