Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access Webapp: Table to Query to Table

Posted on 2016-10-03
14
Medium Priority
?
76 Views
Last Modified: 2016-10-06
Hi all,
my query is ,

If suppose I have 2 tables:

AB

A has Field Name ProjName with Value Prj-1

If I create a new Query and Add Table A and double click on Field ProjName  it gets added and I save it with name Prj_Qry

so now  Value Prj-1 from  Field Name ProjName from Table A is saved into query Prj_Qry

B has Field Name Name

now I want to export that  Value Prj-1 to Field Name Name , in Table B , How do I do that using a query?

PS.
I want to fetch value from A into Query and Export that Query Value to B.

How do I do this?  I already fetched value from A as I said above, I just want to export to a FieldName in Table B.

Thank You
0
Comment
Question by:Satish Kumar G N
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
  • +2
14 Comments
 
LVL 30

Expert Comment

by:Pawan Kumar
ID: 41826755
Can you post your table and the expected output you need?
0
 
LVL 85
ID: 41826806
Is this the same basic question you've asked here:

https://www.experts-exchange.com/questions/28973883/Access-Web-App-Primary-Foreign-Key-Fetch-Values.html

It seems to be so, with the names changed a bit.
0
 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41826844
Hi Scott, that is different there I asked to fetch values from table to table. but here I want from table A to a query, and then export query value to the Table B
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41826851
Hi Pawan, I think I have clearly mentioned every step in detail. Table for now is just an imaginary and simple thing is that I need to fetch value of a field in table A to Query and export it to Field in B.
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 41826855
Why don't you use a simple query like
insert into B ([Name]) select [ProjName] from A

Open in new window

0
 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41826882
Hi Ferruccio,
I am creating this in Access Web app.  Not SQL
0
 
LVL 85
ID: 41827114
Why use a Query?

Can you not make a form based on TableB, and then include a Combo with a RowSource from TableA? That would store the value from TableA in TableB, without needing to use a Query.

Note you cannot really "update" in this manner in a WebApp. You use Data Macros to do this ...
0
 
LVL 85
ID: 41827117
Also, as suggested in several of your other questions, you really should work through several of the basic tutorials on working with WebApps, like this one:

https://msdn.microsoft.com/en-us/library/office/jj249372.aspx?f=255&MSPPError=-2147217396

Many of the questions and concepts you're asking about would very likely be answered in tutorials like that.
0
 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41827502
Hi Scott,

Yes you are correct I used Data Macros for the same.
I created DataMacro After Insert in My table1 to create record in Table 2.
Limitations are the data just remains there for only one entry in Table 2.
when I create one more record all the data is cleared (one more record here means if I click + in table 2's field it will create new record old created record isn't there anymore).

If you can resolve this I can proceed with the same.

Thanks.
0
 
LVL 22

Accepted Solution

by:
crystal (strive4peace) - Microsoft MVP, Access earned 2000 total points
ID: 41827520
You should not be duplicating values in a related table.  The only value that should be the same is called a foreign key and it has the same value as the primary key in the main table.  I put an example on your other thread.

Once this relationship is properly set up, the views can be linked and you will no longer have to worry about this.
0
 
LVL 85
ID: 41827835
As Crystal has said, if you're storing the SAME value in multiple tables, then you're doing this incorrectly.

If you're trying to store the Parent PK value in the Child table, then that's the way you should be doing this.

From what you've written, it's not at all clear what you're trying to achieve. Are you working directly at the table level, or have you created Views for those tables?

Also, have you taken time to review those tutorials I suggested? We can't help you if you're not willing to put in the time it takes to learn the platform.
0
 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41828631
Scott & Crystal,

I will give a brief of my project in simple terms.

There needs 2 tables ProjectPlanningProjectForecast
 
in ProjectPlanning we do enter planning for that project details that needs to be constant till changed.

fields are :
 
   
  • SapID
   
  • ProjectName
   
  • ProjectManager
   
  • GroupHead
   
  • GrossMargin
   
  • Advances
   
  • Retention
   
  • TDforStock
   
  • TDForTrading

in ProjectForecast those above constant values with other values are in this ProjectForecast . In ProjectForecast table there are total of 33 fields. out of which the above 9 fields should be constantly be available till the data in it is changed.

that is because the records in ProjectPlanning  remains same for multiple projects in  ProjectForecast  , when needed we Update data in ProjectPlanning same should reflect in
ProjectForecast  for the new records we keep creating.


I have attached the example in the pic

   forecast.png

the purpose of creating planning table is to reduce the effort of entering them manually again and again for different projects.


how can i create this? what method to follow , kindly help me with this.  

please use my data entered here and guide me how can i do that in few steps and macros wherever i need to create them.

what values can i use as primary and foreign key in which table.

Thanks.
0
 
LVL 22
ID: 41828961
when you ask questions, please close them properly before abandoning the thread, like here:
https://www.experts-exchange.com/questions/28969679/Access-Webapp-Using-After-Update-Event-in-Retain-Macro-Values-till-Changed.html

You have actually gotten lots of help!
1
 
LVL 1

Author Closing Comment

by:Satish Kumar G N
ID: 41831496
Thank you crystal for your help and support.
0

Featured Post

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question