Solved

How do i fetch data from one table to another (lookup) - Related to Access Web APP

Posted on 2016-08-24
14
53 Views
Last Modified: 2016-10-04
My question is related to Ms Access Webapp.

I have 2 Tables (Fields):

User Entry - Primary Data (SAP ID, Project Name, Project Manager)

User Entry - Planning Data (SAP ID (lookup from prev table), Project Name (lookup from prev table), Project Manager (lookup from prev table), many more values (not lookups from prev table))

I want to know how can I import values entered in

User Entry - Primary Data (SAP ID, Project Name, Project Manager)

to

User Entry - Planning Data (SAP ID (lookup from prev table), Project Name (lookup from prev table), Project Manager (lookup from prev table), many more values (not lookups from prev table))

what data macro to be used? or insert event or anything else.

Note: while answering please use my terms and answer please.

Thanks & Regards,
Satish Kumar G N
0
Comment
Question by:Satish Kumar G N
  • 6
  • 4
  • 2
  • +1
14 Comments
 
LVL 50

Expert Comment

by:Steve Bink
ID: 41771778
Something like this:
INSERT INTO MyOtherTable (field1, field2, field3) 
SELECT field1, field2, field3 from MyOriginalTable;

Open in new window


The field lists in each part of the query need to match.  Any fields not inserted into the destination table (e.g., field4), must be capable of auto-populating their value (i.e., accepts NULLs or be assigned a default value).
0
 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41771903
Hi Steve,
Thank you for your reply, I have referred to Ms Access Webapp, not SQL database. Please do have a check and respond back.

Kind Regards,
Satish Kumar G N
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 41772696
Behind every web app is a database, either SQL Server or Azure.  AFAIK, to do what you want, you'll have to connect to that database to execute SQL.
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 41773070
Satish,

1. Open the table On User Entry - Primary Data.
2. Click on the Design tab.
3. Hit the dropdown on "Create Data Macros"
4. Choose "After Insert"

the marco editor will open.

From the dropdown, choose "Create Record"

Enter the table User Entry - Planning Data  in the "Create record In"

Then in the next drop down, choose "SetField"

Name the field.

Value is User Entry - Primary Data.<field name here>

Each field must be done separately.

I believe that will work.   I don't use Web apps myself, so I'm basing this on what I've seen.

Jim.
0
 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41774519
Hi Jim Dettman,
Thank you for your reply, I did the same thing, but I get this error always. I get Identifier when i set name as SAPID
0
 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41774533
I get this error while entering the value into the User Entry - Primary Data in SharePoint Site.

error2.png
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 57
ID: 41774559
It's saying it cannot find "SAPID"

is that the correct field name?

Should it not be "[SAP ID]"?

Jim.
0
 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41774602
I solved the SAP ID Error, but it does show the error mentioned below, the access services error, if I solve that too, when I enter setfield it updated, but the data is showed in drop down list, I don't want in drop down list, it should automatically fetch the value inserted in User Entry - Primary Data . [SAP ID]

thanks
Sat
0
 
LVL 57
ID: 41774762
<<I solved the SAP ID Error, but it does show the error mentioned below, >>

 Really should ask a separate question for that.

 But if you click on "Technical Details", what does it show you?    It sounds though like it is simply the wrong data type (numeric vs text for example).

Again, I have not worked with web databases, so I may not know the answer to this.   It would be better if you posted a separate question to attract the attention of others.

Jim.
0
 
LVL 1

Author Comment

by:Satish Kumar G N
ID: 41777535
Hi Jim,
Actually what happens here is I have set
[SAP ID], [Project Name] to Short Text/Long Text then ;

Error:
Access can't convert the value of 'prj01' to the specified data type.
TECHNICAL DETAILS
Correlation ID: a9159f9d-8021-2000-ad06-237fc13f4fca
Date and Time: 8/30/2016 10:58:51 PM


For Data Type: Number

Error:
You cannot add or change a record because a related record is required in table User Entry - Primary Data.
TECHNICAL DETAILS
Correlation ID: 09169f9d-b099-2000-ad06-210ec81217d4
Date and Time: 8/30/2016 11:05:27 PM


when I have normal Lookup it shows values inserted in User Entry - Primary Data as Drop down list in User Entry - Planning Data


Out Put Required :
All values in User Entry - Primary Data, Auto Filled to User Entry Planning - Data ;  Not Drop Down List.

Thanks
Sat
0
 
LVL 57
ID: 41777909
I am not sure I understand what it is your trying to do here.

As I said, I have not worked with web databases at all.  Let me try and find someone who has.

Jim.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 41791850
https://support.office.com/en-us/article/Create-an-Access-app-25f3ab3e-510d-44b0-accf-b976c0813e71?ui=en-US&rs=en-US&ad=US

An Access app is a database that you use in a standard web browser, but which you design and modify in Access 2013 or later. The data and database objects are stored in SQL Server or Microsoft Azure SQL Database, so you can share the data within your organization using on-premises SharePoint 2013 or Office 365 for business.

Knowing that data seems to be stored in SQL server or Azure and the type of errors you are getting, it sounds like the data types may not be matching up.


Error:
Access can't convert the value of 'prj01' to the specified data type.
TECHNICAL DETAILS
Correlation ID: a9159f9d-8021-2000-ad06-237fc13f4fca
Date and Time: 8/30/2016 10:58:51 PM

For Data Type: Number

It looks like the field in question is trying to convert text to a number.

Start by detailing your file layout with file types.  Make sure the fields match up. If you have a date field, make sure you are saving date data formatted as a date.  If you have an Integer field,  make sure the data you are saving is an integer etc.
0
 
LVL 1

Author Closing Comment

by:Satish Kumar G N
ID: 41829187
this assissted me as the solution.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now