Access 2013 - web app - table events - multiple record update (1 Viewer)

tacklers

New member
Local time
Today, 12:42
Joined
Jun 11, 2014
Messages
6
Working through Inside Out/Microsoft Access 2013 I cannot suss whether it is possible to update two tables in one on-event section.

On a record create I have an on-insert macro and read a table to retrieve a reference number.

I cannot update this table in the same on-insert section, I have to put the same code in the on-update event trigger.

What am I missing?
 

pr2-eugin

Super Moderator
Local time
Today, 12:42
Joined
Nov 30, 2011
Messages
8,494
Hello tacklers, Welcome to AWF :)

Could you be more generic in your explanation. Probably explain in simple words without any Access jargon; what is that you wish to do. So we can guide you correctly?
 

tacklers

New member
Local time
Today, 12:42
Joined
Jun 11, 2014
Messages
6
Thanks Paul.

When a new record is created I want to assign it a reference number which is held in another table. I do a Lookup okay, I then want to increment the reference number by one, ready for the next create, but cannot do a setfield/edit on the record 'looked up' there are context message issues.

I had thought to do both updates from a macro associated with an on-insert event but it appears I can only set fields in the 'new' record being created.

I have now coded a data macro which is called from the on-insert macro this works, is it the 'standard' way or should I have been able to update the reference table as inline code in the on-insert event macro?

Cheers.
 

AccessJunkie

Senior Managing Editor
Local time
Today, 04:42
Joined
May 11, 2006
Messages
278
Hi,

You should be able to set fields in records being "looked up" through the Look Up Record data action. You just have to remember that in order to use a Set Field action, it has to be wrapped inside an EditRecord data block first.

Is this not working for you?

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
Senior SDET - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2013 Inside Out
Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010/2013 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 

tacklers

New member
Local time
Today, 12:42
Joined
Jun 11, 2014
Messages
6
AhHa,

Got it. Yes, an edit record block within a lookup does work. Thank you.

I had gone around the houses looking at context and aliases.

Really appreciated.

Cheers, Richard
 

Users who are viewing this thread

Top Bottom