|
-
Feb 24th, 2012, 02:08 PM
#1
Thread Starter
Addicted Member
updating a field in Access 2003
This looks so simple, but duH.
I have 2 tables New-Products and Products-List, they both have a field called Codes in them
In the update form I have a field that uses a combobox of "Items" from Products-List, when the user selects an item, it triggers an AfterUpdateEvent.
this is where I have trouble, how do I get the selected "Codes" value from Products-List table to update the "Codes" field in New-Products???
I tried this, but get errors... "Can't find the field '|' referred to in expression.
Private Sub Product_AfterUpdate()
[New-Products]![Codes] = [Product-List]![Codes]
End Sub
thanks,
-
Feb 24th, 2012, 02:25 PM
#2
Re: updating a field in Access 2003
Can't really tell from that little bit of code. It looks like you are trying to reference by the names in the database like you would in a query but if you are trying to update 1 recordset with the value from another you must reference the recordset object by the name of the recordset and loose the []s
-
Feb 24th, 2012, 03:59 PM
#3
Thread Starter
Addicted Member
Re: updating a field in Access 2003
this is not done with recordsets or commands, this is done in a macro, so according the to samples I have seen it is done like what I showed, but obviously not quite.
-
Feb 24th, 2012, 04:19 PM
#4
Re: updating a field in Access 2003
Oh, Sorry then, I have never actually worked with macros in Access for this type of thing. I have worked with Access quite a lot over the years but I always do my coding in VB and use Access as a data storage container.
-
Feb 25th, 2012, 12:27 PM
#5
Re: updating a field in Access 2003
Thread moved from the 'VB6' forum to the 'Office Development/VBA' forum (while VBA and VB6 have some similarities, they are not the same thing)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|