var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Shouldn't this be simple (UPDATE RECORD)
I can't believe I am having this problem but I am. I have 2 tables.
Table 1: Customer Records
Table 2: Policy Records
This is how it looks in the form:
ID Name Project Policy
1 dbplus 001 General
ID, Name and Project fields are in the parent table. ID is autonumber. Policy is in the child table (foreign link ID -- ref integ)
My problem is only when I add a new record. When I add a record and update in the form Name and Project everything is ok. When I go to add Policy my script has trouble.
It looks for the current record ID number in the parent table. This has not been established because the record is not "UPDATED".
Since on the form the child table and the parent table data are merged the record does not advance and update until both are updated.
So what I need is an update on the parent table before it advances to the Policy Field. AfterUpdate on the Policy field initializes the script and fails because ID (Autonumber) has not been updated.
I thought that this would be simple with a simple UPDATE command but it is not working.
See if forcing the record to save helps:
If Me.Dirty Then Me.Dirty = False
You're not trying to save records into two tables at the same time are you?
Normally, the parent table would be in a mainform and the child table fields would be in a subform on the mainform. Is this what you are doing? Sure doesn't sound like it!
Owner and Manager of
CypherBYTE, Microsoft Access Development Specialists.
Microsoft Access MCP.
And all around nice guy!
"Heck it's something understood by accountants ... so it can't be 'that' difficult..."
"...teach a man to code and he'll be frustrated for life! "