Inserting form values into a table

We have a form with values taken from an sql query that comes from two
different tables.  We would like to enter the information into a third table.
Can some one direct me to code that will do the following:

1.  Provide the Insert sql that shows us how to add the form values to the
table
2.  Show us how to loop while inserting the information into the table (there
could be several lines on the form, each must be inserted one at a time).

I have worked with Access before and have never had a problem inserting
information.  However, I cannot quite figure out how to insert informtion
through an Access form.  By the way, we are using Access 2000.

Any help will be greatly appreciated.

-- 
Message posted via http://www.accessmonster.com

0
dufnobles
10/18/2007 4:15:55 PM
access.formscoding 7493 articles. 0 followers. Follow

4 Replies
883 Views

Similar Articles

[PageSpeed] 48

How does the form insert data when it comes from several different tables?

dufnobles wrote:
>We have a form with values taken from an sql query that comes from two
>different tables.  We would like to enter the information into a third table.
>Can some one direct me to code that will do the following:
>
>1.  Provide the Insert sql that shows us how to add the form values to the
>table
>2.  Show us how to loop while inserting the information into the table (there
>could be several lines on the form, each must be inserted one at a time).
>
>I have worked with Access before and have never had a problem inserting
>information.  However, I cannot quite figure out how to insert informtion
>through an Access form.  By the way, we are using Access 2000.
>
>Any help will be greatly appreciated.

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

0
dufnobles
10/18/2007 6:01:54 PM
I may be missing something...

It sounds like you want to take data you already have and duplicate it in 
another table.  Why?

If you can write a query that retrieves the data from the (two) table(s), 
why not use the query as your source, rather than adding another table?

More information, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP

"dufnobles via AccessMonster.com" <u37896@uwe> wrote in message 
news:79e1c60005b27@uwe...
> We have a form with values taken from an sql query that comes from two
> different tables.  We would like to enter the information into a third 
> table.
> Can some one direct me to code that will do the following:
>
> 1.  Provide the Insert sql that shows us how to add the form values to the
> table
> 2.  Show us how to loop while inserting the information into the table 
> (there
> could be several lines on the form, each must be inserted one at a time).
>
> I have worked with Access before and have never had a problem inserting
> information.  However, I cannot quite figure out how to insert informtion
> through an Access form.  By the way, we are using Access 2000.
>
> Any help will be greatly appreciated.
>
> -- 
> Message posted via http://www.accessmonster.com
> 


0
Jeff
10/18/2007 6:09:02 PM
Thanks Jeff.

I need to clarify.  My form is a survey response form.  If I have a survey
question that needs four responses, then I display four rows, one for each
answer.  This works fine.

My problem is that once the user fills in the four rows, I do not know the
best procedure to store all four rows of text into another table that was
created to hold the responses.  I have a Save button but I am unsure of the
logic needed to get all four responses added to the table.  

Thanks.

Jeff Boyce wrote:
>I may be missing something...
>
>It sounds like you want to take data you already have and duplicate it in 
>another table.  Why?
>
>If you can write a query that retrieves the data from the (two) table(s), 
>why not use the query as your source, rather than adding another table?
>
>More information, please...
>
>Regards
>
>Jeff Boyce
>Microsoft Office/Access MVP
>
>> We have a form with values taken from an sql query that comes from two
>> different tables.  We would like to enter the information into a third 
>[quoted text clipped - 12 lines]
>>
>> Any help will be greatly appreciated.

-- 
Message posted via http://www.accessmonster.com

0
dufnobles
10/18/2007 7:31:12 PM
I'm still having trouble visualizing the data you have and what you are 
trying to do with it.

You've described the form ("four rows"...), but why, for example, are there 
four, rather than 3 or 5 (or just 1)?

You've described storing the rows/responses into a table to hold 
responses... but I don't have a clear picture of your data structure.

It all starts with the data.  Please post a description of the tables you 
currently have set up.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"dufnobles via AccessMonster.com" <u37896@uwe> wrote in message 
news:79e37a2560add@uwe...
> Thanks Jeff.
>
> I need to clarify.  My form is a survey response form.  If I have a survey
> question that needs four responses, then I display four rows, one for each
> answer.  This works fine.
>
> My problem is that once the user fills in the four rows, I do not know the
> best procedure to store all four rows of text into another table that was
> created to hold the responses.  I have a Save button but I am unsure of 
> the
> logic needed to get all four responses added to the table.
>
> Thanks.
>
> Jeff Boyce wrote:
>>I may be missing something...
>>
>>It sounds like you want to take data you already have and duplicate it in
>>another table.  Why?
>>
>>If you can write a query that retrieves the data from the (two) table(s),
>>why not use the query as your source, rather than adding another table?
>>
>>More information, please...
>>
>>Regards
>>
>>Jeff Boyce
>>Microsoft Office/Access MVP
>>
>>> We have a form with values taken from an sql query that comes from two
>>> different tables.  We would like to enter the information into a third
>>[quoted text clipped - 12 lines]
>>>
>>> Any help will be greatly appreciated.
>
> -- 
> Message posted via http://www.accessmonster.com
> 


0
Jeff
10/19/2007 3:26:16 PM
Reply:

Similar Artilces:

synchronize sub forms-part 2
Trying to sync subform records. Used code from my previous question on this subject, but records do not sync until after the record is changed (on navigation bar). I have a main form (frm1) and six sub forms (fsub1-fsub6). In fsub1 On Current Event: Forms![frm1]![fsub2].Requery In fsub2 On Current Event: If IsNull(Forms![frm1]![fsub1].Form!ID) = False Then Me.RecordsetClone.FindFirst "[ID] = " & Forms![frm1]![fsub1].Form!ID Me.Bookmark = Me.RecordsetClone.Bookmark Else Forms![fsub1].SetFocus DoCmd.GoToRecord , , acNewRec End If ...

Pivot table export data to table format
I have a pivot table with the row heading listed once for multiple crosstab line items. I need to use this data for a report that will list the row heading on each row for each cross tab line item. Is this possible? I have tried everything... nothing seems to work. You can't get the heading labels to repeat in the pivot table. You could copy the pivot table, and paste as values on a different sheet in the workbook. Then, fill the blank cells, and format the copy of the pivot table. There are instructions here for filling in the blank cells: http://www.contextures.com/xlDataEntr...

Calling a subform from another form
I've been trying for about a week now to figure out the code for this. Here's what I'm doing - I have a form (frmSelectQuestions) with unbound combo boxes filled in with values I entered. I want frmSelectQuestions to show only records that correspond with the combo boxes. The info I want to filter is on a form (frmSelectDropDown) that contains a subform (frmToDoListGoalsDropDown). I want to filter by controls on both the form and subform with just the one command button on frmSelectQuestions. I hope this makes sense. Here is my code. I keep getting that it can't f...

Importing Outlook emails into an Access table
I know that I can import data from my Outlook inbox by going to File -> Get External Data -> Import -> Select Files Of Type Outlook() etc... using the wizard but can this be done systemically via VBA code similarly to transfer text. I actually need to import data from a group account at work. I have searched hi and low through the Newsgroups and web and have found nothing. Any help would be much appreciated. Thanks to all in advance, Markco NEWSGROUPS wrote: > I know that I can import data from my Outlook inbox by going to File -> Get > External Data -> Import -...

Wacky Default Values
I have a picklist in both my Contact and Account records with a default value set. If I create a new Contact or Account, this default value works properly. However, when I convert a Lead to either a Contact or Account, this value appears in the record when it is pulled up, but it is displaying a blank in all my views. Has anyone experienced this situation and/or have any suggestions? ...

Checking for currency value between range
I have two txtboxes (txtWeeklyAllowanceLow, txtWeeklyAllowanceHigh) on a search form that I would like to use to find all weekly allowances on a table that fall within the range specified. Also if only a low amount is entered, then I would like all allowances greater than the amount to display, or if only a high amount then all allowances less than what is given. Any help with how I should code this would be great. thanks! Ok. Update. I seem to have the filter working for the high as well as the between, but now the low seems to not work. Here is the relevant code so far.. 'If W...

Display Negative Time Values on Y-Axis
I'm plotting timed events against a set schedule (actual lap times vs predicted times) and am calculating the difference and plotting the results. In Excel 2003, I would use the 1904 Date System (Tools, Options, Calculation tab) to display negative time values and then force the chart to link to the source data to determine the format. It would display positive and negative time values on the y-axis In Excel 2007, changing to 1904 date system will show negative time values in the spreadsheet AND will plot negative points on a chart, but WILL NOT DISPLAY NEGATIVE TIME VALUES ON THE Y-AXI...

powerpoint 2007 VBA form's window not retaining size
WEIRD BEHAVIOR When I create a VBA form in PP 2007 and run the form it automatically resizes (it width doubles). THis occur even when the are only one or two lines of codes such as Private Sub UserForm_Initialize() Me.Left = 100 Me.Top = 10 end sub However this automatic increase in width does not occure wirh this code Private Sub UserForm_Initialize() exit sub Me.Left = 100 Me.Top = 10 end sub There is no subs for resizing or activating the form so it can not come from there ...

MS Access 2007
We have just installed MS Office 2007 and we have access 2007. When tried to open a form a message is displayed saying the transaction and/ or form is disable. We have not make any changes to this form, is the first time that we use this form with MS Access 2007, does anyone knows what is the problem? Or how to go about it? Please advise, Luis ...

Report Writer
I want to add a table (HR_EMPLOYEE_EXTRA) to the HR Employee Emergency Contact report. Can this be done? I looked but could not find a way to do it through Report Writer. I'm sure there must be a way but it'll take some more looking. It would be much easier to build a report using SmartList Builder or a different report writer. -- Charles Allen, MVP "Bob Harrison" wrote: > I want to add a table (HR_EMPLOYEE_EXTRA) to the HR Employee Emergency > Contact report. Can this be done? ------=_NextPart_0001_8D212269 Content-Type: text/plain Content-Transfer-Enco...

Opening a user form
I am using the following code to open a user form when I open a Word 2003 document. Private Sub Document_New() UserForm1.Show End Sub For some reason I can't get the user form to show. I have this code in a template and I am opening the document from it. I also have it in a private directory (not the template directory). Thanks, Stanley That does not make the userform show on document open. Sub Document_Open() UserForm1.Show End Sub If you have the code (Document_NEW) in the template, then when the template is used to make a NEW document, the userform will displa...

Form not closing for event "leaving field"
Within a form the input-data (number) is checked wether it is already in the database. If it is already in the database, I want to open a new form and close the first form. But, when trying this, I always get the errorr "can't close form while event still running" (sorry, it is a translation from german). Any helpful hints how to solve the problem Thanks in advance Jokobe jokobe, Does that mean that when the input data is already in the db the record is not saved or shouldn't be saved? My guess is that your form state is still 'dirty' and therfore doesn't...

More Control on Left navigation in Detail Forms
Need more control to move up and down the Left navigation on the detail forms when database references are created. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=a5f9d83f...

Colouring any cell in worksheet with negative value
Hi all, I have written the below code for making the cells from column to A to BB fill with red colour, if they have a negative value in them. I can't seem to make it work. Any help will be appreciated! Thanks very much! Shivam ****************************** Private Sub Worksheet_Change(ByVal Target As Excel.Range) Const ColumnsToCheck As String = "A:BB" If Not Intersect(Target, Range(ColumnsToCheck)) Is Nothing Then If Target.Value < 0 Then Target.Value.Select Selection.Interior.ColorIndex = 3 End If End If End Sub...

E-forms language not present.
I'm needing to install a new Eforms Registry on one of our Exchange 2003 Enterprise servers. However, the "English(USA)" selection is missing from the E-forms Language pull-down menu. Anyone know the process (or pointer to the process) to add the language? Thanks... ------------------------------------------------- Only in America will someone | order a Big Mac, large fries, | bofh@visi.com and a *Diet* Coke... | That usually means that it is already installed. Double check the Eforms registry. Nue "john doe" <bofh@visi.com> wrote in message new...

Pivot table calculated field
I am using a Pivot table to get the total amount of orders to customer from a database. I have built the pivot table with a calculated field since the total amount for each order is missing in the database. The calculated field = no of products * price per product For each specific order Excel calculates the row correct. For the total of each customer and for the pivot table Grand total i seems as Excel is calculating like this: (sum of all prices) * (sum of all numbers of products) = Total pe customer (& Grand total) Is there a way to change the way Excel calculates the totals? If ...

Updating column values only if value is not null
Hi, I have 2 tables. I have a query that updates the values of some columns from table A with values from some columns of table B based on a given condition. Something like this: Update T1 Set T1.C1 = T2.C1, T1.C2 = T2.C2, T1.C3 = T2.C3 FROM A T1 INNER JOIN B T2 ON <my condition> That's simple to do, but I was wondering how I can only update the columns where the value of the column of table B is NOT NULL. The reason is because I don't want to overwrite not null values in table A with a NULL value. In that case I want to leave as it is. Thanks Upda...

locking data values from links
-------------------------------------------------------------------------------- I am working on a spreadsheet with links. A value is placed in the master sheet and is then linked back into the sub sheet. Everytime a value is placed in master sheet, the sub sheet is updated. However, Im trying to put a new column in the sub sheet, and make the master sheet update this new column. However I want the old column to have the last updated data before the new column was put in. How do i do this? and does anyone have ne VB codes to achieve this? -- ashcrusher ------------------------------------...

Cond. Form. Question
How do I make a text cell(A1) change color if it is between zero to 14 days from the current date(A2)? But I also need it to drop the color after the date passes and go back to transparent. Thanks. In a cell, enter =today(). Let's say this is cell b1 Select your date. Format>Conditional format Use Between $b$1 and $b$1+14 and select format Red -- Kind Regards, Niek Otten Microsoft MVP - Excel "Roger Fuherdenhaden" <xxxx@ii> wrote in message news:ovqdneMricl0c6PdRVn-gg@comcast.com... > How do I make a text cell(A1) change color if it is between zero to 14...

getting cell color to allow alternating blocks of like value == like color cells
I have seen this asked a few places and some answers, but nothing that works. I want to simply alternate the color of a col so blocks of identical values have the same color. Thus A black A black B blue C black C black A blue B black C blue C blue C blue If you could get the cell color in a formula you could do it painfully as in a formula for black and a formula for blue applied to all but the first row. So the formulas would be along the lines of if x!=above cell and above cell is blue or x==above and above cell is black -> format black if x!=above cell and above cell is black or ...

Generating a report from a form
Hi to those of you who may be looking at doing what I have just found my way through. I have a single field form (an unbound text box) that the user enters data into. The code then checs the database table for all records with the same field value as that entered on the form. A report is then generated from this data so that the user can view all of the records with that field value etc. The code below works fine, at least for me: Private Sub FindRecords_AfterUpdate() Dim strCriteria As String Dim stDocName As String stDocName = "Report Table" strCriteria = "[Tag Numbe...

Exposing Opportunity ID GUID on Form
Hi, anyone know of an easy way to expose Opportunity ID GUID on one of the tabs in Opportunity form? If you need the Guid for further development, simply press CTRL-N or F11 and copy it from the IE address bar. If you really want to show it on the form, then store crmForm.ObjectId in any field on the form. -- Michael H�hne, Microsoft Dynamics CRM MVP Web: http://www.stunnware.com/crm2 Feed: http://www.stunnware.com/crm2/atom.aspx Custom Lookup Dialog: http://www.stunnware.com/crm2/?area=customLookup The JavaScript Snippets Directory: http://www.stunnware.com/crm2/topic.aspx?id=JS13 --...

getting date in special form
Hi all i have a sheet with dates of the following form Year Month Day 1993 May 23 1991 January 28 and i want to gather them into one row instead of three so i want something of this format I Wana Get 23-05-93 28-01-91 How is it possible? Help appreciated Hi Try =--(C2&"/"&B2&"/"&A2) Format the cell, Format>Cells>Number>Custom> dd-mm-yy -- Regards Roger Govier "Totti" <saliba.toufic.george@gmail.com> wrote in message news:13af065a-2645-41ce-aa0f-a17ed5da333e@i18g2000prf.googlegroups.com... > Hi all i have a sheet with d...

Protecting Formulas in Tables
In Excel 2007 I have a formatted table, 10 columns wide, in which 5 of the columns have formulas. There is a nice feature in Excel 2007 that allows me to type a value in a cell which is directly beneath the table and the table then expands to “consume” that value and automatically fills the remaining columns in the table with, where appropriate, the formulas. I want to protect the table so that the formulas are not inadvertently overwritten AND take advantage of this feature. However, if I lock and hide the cells, then Protect the worksheet, this feature is disabled. Ca...

Insert Ribbon mostly disabled
Using Office 2007 Pro w/XP. While making a lot of changes to a copy of an existing workbook I noticed I couldn't not insert a Text Box. Upon further review it appears the Insert ribbon has most of the buttons disabled. I was protecting sheets/adding edit ranges etc. when this may have occurred. I've uprotected everything, deleted the edit ranges but can't get back to previous good state. Any ideas where I could check? Thanks for you help. Kim Is the workbook shared? "Kim" wrote: > Using Office 2007 Pro w/XP. While making a lot of changes t...