Loop through records, pop up window for data and insert

Hi All!
Is it possible to loop through records and pop up a window for additional
data, then insert the record? at present I have this:
Dim SQLStr As String
If MySelected2 <> "" Then
SQLStr = "INSERT INTO ATTENDANCE (ATT_HDR_ID,STUDENT_ID,EVENT_ID,LOCATION_ID,
EVENT_DAT,COMMENT,PHYSICAL_LIMITS,EVENT_FEE) SELECT " & Forms!ATTENDANCE_HDR.
ATT_HDR_ID & " as ATT_HDR_ID, STUDENTS.STUDENT_ID AS STUDENT_ID," & Forms!
ATTENDANCE_HDR.EVENT_ID & " as EVENT_ID," & Forms!ATTENDANCE_HDR.LOCATION_ID
& " AS LOCATION_ID,'" & Forms!ATTENDANCE_HDR.EVENT_DAT & "' as EVENT_DAT, '',
'',0 FROM STUDENTS WHERE STUDENT_ID IN (" & MySelected2 & ")"
DoCmd.SetWarnings False
DoCmd.RunSQL (SQLStr)
DoCmd.SetWarnings True
Set colCheckBox = Nothing
   Me.Requery
   Forms!ATTENDANCE_HDR!sfmstudentclasslist.Requery
 End If
inserting records just fine. But some of our classes require fees, and I
would like to pop up a small form to add the amount (different for each
student) and then insert each record.
Yes? No? better ideas?
Thank you
Andy

-- 
There's never enough time to do it right, but there's always enough time to
write a patch...

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200712/1

0
steamngn
12/13/2007 9:52:05 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
855 Views

Similar Articles

[PageSpeed] 36

Yes, is is possible to do what you want. Your code does not seen to the
complete code for the event/sub/function. 

Where is this code?

What is "MySelected2"? 

How will you know what recordset to loop through?

steamngn wrote:
>Hi All!
>Is it possible to loop through records and pop up a window for additional
>data, then insert the record? at present I have this:
>Dim SQLStr As String
>If MySelected2 <> "" Then
>SQLStr = "INSERT INTO ATTENDANCE (ATT_HDR_ID,STUDENT_ID,EVENT_ID,LOCATION_ID,
>EVENT_DAT,COMMENT,PHYSICAL_LIMITS,EVENT_FEE) SELECT " & Forms!ATTENDANCE_HDR.
>ATT_HDR_ID & " as ATT_HDR_ID, STUDENTS.STUDENT_ID AS STUDENT_ID," & Forms!
>ATTENDANCE_HDR.EVENT_ID & " as EVENT_ID," & Forms!ATTENDANCE_HDR.LOCATION_ID
>& " AS LOCATION_ID,'" & Forms!ATTENDANCE_HDR.EVENT_DAT & "' as EVENT_DAT, '',
>'',0 FROM STUDENTS WHERE STUDENT_ID IN (" & MySelected2 & ")"
>DoCmd.SetWarnings False
>DoCmd.RunSQL (SQLStr)
>DoCmd.SetWarnings True
>Set colCheckBox = Nothing
>   Me.Requery
>   Forms!ATTENDANCE_HDR!sfmstudentclasslist.Requery
> End If
>inserting records just fine. But some of our classes require fees, and I
>would like to pop up a small form to add the amount (different for each
>student) and then insert each record.
>Yes? No? better ideas?
>Thank you
>Andy
>

-- 
Boyd Trimmell
aka HiTechCoach
http://www.hitechcoach.com
http://www.officeprogramming.com

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200712/1

0
Boyd
12/15/2007 5:48:19 AM
Boyd Trimmell aka HiTechCoach wrote:
>Yes, is is possible to do what you want. Your code does not seen to the
>complete code for the event/sub/function. 
>
>Where is this code?
>
>What is "MySelected2"? 
>
>How will you know what recordset to loop through?
>
>>Hi All!
>>Is it possible to loop through records and pop up a window for additional
>[quoted text clipped - 20 lines]
>>Thank you
>>Andy
>
Hey Boyd,
MySelected2 is a function that loops through checked names and builds a
string like "where student_id in (1,2,3)"
I think I came up with a better solution, though, that will prevent the user
from inserting bogus data. Thanks for the look though!
Andy

-- 
There's never enough time to do it right, but there's always enough time to
write a patch...

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200712/1

0
steamngn
12/16/2007 8:56:00 PM
Reply:

Similar Artilces:

error in importing data
Sorry the error is 0x8004032d ...

Inserting a Row from a UserForm
Hi guys- I'm kind of a self-taught VBA programmer and I can usually blunder around and get a macro to work, but I'm having trouble with a rather difficult one right now. I've created a UserForm that has 6 fields the user has to fill in for a database. Once the user hits the "OK" button, I want the macro to look for the last entry in the database that is identical to what the user filled in Field 1 of the UserForm and insert a row beneath it and fill in the cells with the data from the UserForm. So, i.e: Apple Apple Orange Orange Orange Banana Grape Grape If I type &...

Re: Extracting Exchange User Data From AD 02-24-10
If you do not like scripting, you can try GAL Exporter or Fast User Manager & Reports from IMIBO - http://www.imibo.com > > "Ringholz, Blake" <bringholz@nospam.com> wrote in message > news:76AEFC2F-85A7-4666-8262-27FB0737D09A@microsoft.com... >> Hello All - >> >> I need to get an Excel Spreadsheet that lists everyone first name, last >> name, email address, job title, etc pulled from Active Directory. Is >> there an easy way to do this? >> >> Thanks, >> Blake > > > > > ...

Add a specific Record to a Table based on a check box
I have a Table called ServiceTypes. Based on a User's input on a ProposalForm, ServiceTypes need to be added to a ProposalServicesTable. For instance, I have a Check Box on the ProposalForm. When a Check Box is clicked Yes, Access must search the ServiceTypes Table, select a specific ServiceTypeID, and add the ServiceType to the ProposalServicesTable. How can I add the proper Service record from the ServiceTable to the ProposalServicesTable based on the Check Box? I wouldn't do it that way. I'd use a listbox (with multi-select set to YES) that was sourced to the ServiceTab...

Inserting object
Is there any macro that will allow the use of the insert picture from scanner? I have tried to use the recorder but it never recorded anything when I used it. Any help would be great Thanks Greg hiiiiiii dear friend if u can insert picture from menu for Exp: insert menu Picture ---> from Scanner or Camera if u have such useful command available so whyy u want to try macro. after u try from insert menu it may work out for u but first install the scanner good luck !!!!!!! "Greg B" wrote: > Is there any macro that will allow the use of the insert picture from > sc...

Painting the Blue Gradient BackGround of the Windows TitleBar
Is there any simple way to accomplish this? Never mind. "Peter Olcott" <olcott@att.net> wrote in message news:m8bEg.69$Tl4.40@dukeread06... > Is there any simple way to accomplish this? > > Never mind. How did you achieve it? --- Ajay Just replicate the semi gradient pixels horizontally across the background from the set of fixed values. "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message news:1155613377.419292.72700@75g2000cwc.googlegroups.com... >> Never mind. > > How did you achieve it? > > --- > Ajay > ...

Doing Analysis from large amounts of DATA
Hi all, I have an attachment that's apart of this message & within it I have 3 tabs 1) Revenue 2) Expenses & 3) Net Position. I would like to do some Analysis on the above three thou a way where I can manipulate the Data. How would I go about doing this? I've tried a Pivot Table thou it didn�t work out in the sense that it was messy & just failed in calculating stuff, not sure if I did it right thou.. Would really appreciate all the help as I actually have about 20 of these sheets which from that fall into 4 groups being 5 sheets per group. I hope this all makes sense, wo...

lost data when opening excel workbooks ; text import wizard popup
When opening many of my excel files ,which all have the same modification date, I come across the text import wizard which states that my text in these files is 'delimited'. All of the files ,including a few word doc.s have had their data changed to show all " y " with two dots above the letter for as far as the eye can see. No import or export has been done with the files and no modifications were done on that date, as far as I know. Is this a corruption problem or is their some 'fix' that I am overlooking. Thanks for any ideas. ...

Convert Column to row with variable data
Hi I'm using Excel 2k and I have a spreadsheet that looks like this Name Address Fred 21 Blah St London Sue Tower 50 London EC2 and need it to look like this Name Address 1 Address2 Address3 Fred 21 Blah St London Sue Tower 50 London EC2 I have a macro that can convert from column to row but only for a set number of columns. Is there any way to account for the variable amount of data for each address ? Any help much appreciated Thanks David David: I suggest the following formulae - copied down as necessary: C2: =IF(...

Connection filtering record
1. I have set up connection filtering. How can I see what mail is being rejected? 2. Since setting up connection filtering the email tracking shows all emails being delivered to the intended recipient AND the badmail folder. Could someone explain this? To answer your first question, take a look here: http://www.martijnjongen.com/eng/html/log_analyzer.htm Not sure about the second question. -- Mark Fugatt Exchange MVP http://www.exchangetrainer.com http://www.msexchange.org "Nate" <nmorse@aimcomm.com> wrote in message news:ewUBm6C3DHA.2056@TK2MSFTNGP10.phx.gbl... > ...

Do you need Access to use an Access Database for data entry only?
We have an Access database completed. Now we will use it for reading as well as for data entry. Do we need to install Access for every workstation needing the database for data entry or reading? No you don't necessarily need Access on every computer. You CAN use the Access Runtime and if it is in Access 2007 you can use it for free. If you are using another version then you would need to purchase the developer's edition to be able to legally distribute the associated Access runtime. If you do have 2007 and want to use the runtime, make sure your Full version of Access doe...

windows update 12-25-09
I believe ninety nine percent of the updates failed on my computer. In fact I am unable to download IE8, and several other programs. I am running an IE7 in my computer and I am getting the warning that my os does not support it. What is my operating system? Windows vista basic home, is'nt funny!... Harry Dupre wrote: > I believe ninety nine percent of the updates failed on my computer. > In fact I am unable to download IE8, and several other programs. I > am running an IE7 in my computer and I am getting the warning that > my os does not support it. > > Wh...

Deleting record from bindingsource
Hi I have a winform app with form control bound to a binding source TblClientsBindingSource. The binding source has a data table as its data source as per below code; dAdapter = New OleDbDataAdapter("SELECT * FROM tblClients WHERE ...", Conn) dAdapter.Fill(dTable) TblClientsBindingSource.DataSource = dTable My question is; how do I delete the record currently pointed to by the binding source from the backend database table tblClients? Thanks Regards John wrote: > Hi > > I have a winform app with form control bound to a binding source &g...

Importing data into Outlook #2
Is there a process or program with which I can transfer my ACT! data into Outlook contacts? Thanks! ...

Start Outlook 2003 at windows startup??
Hi, I have a simple question: how do I have Outlook 2003 started automatically and minimized to system tray at windows startup? Thanks in advance edomonet@libero.it <edomonet@libero.it> wrote: > how do I have Outlook 2003 started automatically and minimized to > system tray at windows startup? Put a shortcut to it in your Startup program group. However, I don't believe it will start minimized. -- Brian Tillman It's better to put a shortcut in your Quick Launch bar or you will get errors if OL loads too soon before your connection and antivirus. You can customiz...

Service Pack Installation Issues with GP 9.00.0247.0 on Windows Vi
Greetings, I have installed Great Plains v9.00.0114.0 on Windows Vista. I ran the installation package MicrosoftDynamicsGP-KB923671-v9-ENU, but receive the following messages with result of a failed installation of the Service Pack. Log Name: Application Source: MsiInstaller Date: 10/8/2007 11:50:13 AM Event ID: 11729 Task Category: None Level: Information Keywords: Classic User: ABR\administrator Computer: AD088.abr Description: Product: Microsoft Dynamics GP 9.0 -- Configuration failed. Event Xml: <Event xmlns="http://schemas...

How do insert name automatically atop of each pg of doc?
Hello, How do I automatically insert name on each page of document like inserting page numbers? My professor told me not to type it in but to insert and I have not been able to do so. This is a new program for me, Word 2007. I have to submit my paper in MLA form and do not wish to lose points because for this. Thanks for your help. Click on the Insert tab of the Ribbon and then in the Header and Footer section, click on Header and make your choice from the options presented or click on the Edit Header button to get a blank header pane in which to insert the name in the...

Insert Page Numbers on Worksheet in Excel 2007
In Excel 2003, if you wanted to put page numbers on multiple worksheets in a workbook, you grouped the worksheets and then added a header or footer, using the page number function. All of your grouped worksheets would shows its own page number. But in Excel 2007, only my first worksheet is numbered when I do this (as Page 1). What's the problem? Do I actually have to put a page number, one by one, on each worksheet? I cannot replicate your problem with 2007. Grouped sheets behave exactly as 2003 did. After grouping and adding a header of Page 1 did you do a print p...

How do I show a data table with legend keys in a line chart?
I am having trouble inserting a data table with legend keys into a line chart that contains a horizontal target line. Can anyone help me? Hi, I tried it in both 2007 and 2003 and had no problems. We need more infomation, can you post a sample of the chart somewhere. The only issue I have is that the target line is displayed on the data table, which I would prefer that it not be. -- Thanks, Shane Devenshire "excelbanker" wrote: > I am having trouble inserting a data table with legend keys into a line chart > that contains a horizontal target line. Can anyone he...

Can Work thread get a windows class and manipulate it?
Suppose that I create a work thread when my dialog box started, then in the thread I get the pointer to the dialog mfc class and call updateData method. Does that work? I tried, but failed. Is there any other way to do? thanks!! No, it won't work, don't even waste time trying. It is almost guaranteed to fail. You do not manipulate the windows owned by one thread from a different thread. What you do is PostMessage requests from the worker thread to the main UI thread, usually to the window that contains the controls. The fact that you are using UpdateData already says you are in t...

Output the list of frequent data
Dear all, Here comes two problems. Problem 1: I have a list of strings (say, in the column A1:A100). How can I find the "mode" (i.e. the string appearing most frequently in the list? For example, if the list is APPLE APPLE BANANA APPLE CREAM CREAM BANANA CREAM APPLE DONUT then I want the result is APPLE. It seems that the MODE function does not suppot data type other than numbers. Is there any canned UDF for it? Problem 2: Following Problem 1, I want to generate a list of the 3 most frequent data in the list. If the list is the one in the example, I want to list to be...

Data Validation #47
kshave multiple identacle sheets in a workbook(31 sheets). I am trying to allow users to only enter whole numbers in some of these cells. I know I can do it through Data /Validation/Allow - but, I want to do it on all 31 sheets at once. When I select all sheets - Validation is greyed out. Should I be using a different method? Thanks, Tom Apply the data validation on Sheet1 Copy the cell(s) in which you applied data validation Select Sheet2 Scroll to see sheet31 Hold the Shift key, and click on Sheet31 tab Select the cell where you want to paste the data validation Choose Edit>Paste Cl...

Modifing data to show up better in chart.
My Y1 axis is from 0-250 my Y2 axis is from 0-9000 When graphing percentages the line shows up at the very bottom since 99% < 1 is there a way I can multiply these percentages by 100 to show them as 9900% = 99 Normally you would just make then a 2nd axis but as you can see I already have a second axis of 0-9000 In article <A9E6F75B-7307-4291-BC7D-729F9DF88D50@microsoft.com>, MikePunko@discussions.microsoft.com says... > My Y1 axis is from 0-250 my Y2 axis is from 0-9000 > When graphing percentages the line shows up at the very bottom since 99% < 1 > is there a way I...

Access Outlook Add-in for Data Collection & Publishing won't load
I am trying to utilize the Collect Data via e-mail function and keep receiving the following error: "The Microsoft Office Access Outlook Add-in is disabled in Microsoft Office Outlook 2007. To collect data by using e-mail messages in Microsoft Access 2007, verify that this add-in is installed and enabled from within Office Outlook 2007." I have tried to remediate via the Trust Center/Add-in area in Outlook and don't see an add-in for Access (even though the error message says it is "disabled" it is nowhere to be found). I have tried to add it (I believe it is...

search and insert
Hi, I have trouble figuring out how to search for a particular string in an XML document and annotating it. For example if I'm looking for the string "sentence with tagged words" and wish to annotate it with a "found" tag: original xml: <xml>an example sentence <tag>with tagged words</tag></xml> resulting annotated xml: <xml>an example <found>sentence <tag>with tagged words</tag></found></xml> but also: <xml>an example sentence <tag>with tagged words and more tagged words</tag></xml...