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

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
LVL 1
Satish Kumar G NStudent Asked:
Who is Participating?
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
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
 
Steve BinkCommented:
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
 
Satish Kumar G NStudent Author Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Steve BinkCommented:
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
 
Satish Kumar G NStudent Author Commented:
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
 
Satish Kumar G NStudent Author Commented:
I get this error while entering the value into the User Entry - Primary Data in SharePoint Site.

error2.png
0
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
It's saying it cannot find "SAPID"

is that the correct field name?

Should it not be "[SAP ID]"?

Jim.
0
 
Satish Kumar G NStudent Author Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<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
 
Satish Kumar G NStudent Author Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
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
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
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
 
Satish Kumar G NStudent Author Commented:
this assissted me as the solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.