Add record to a different table than RecordSource (1 Viewer)

stu_c

Registered User.
Local time
Today, 10:23
Joined
Sep 20, 2007
Messages
489
Hi all
bit of a confusing one
TBLProductDetails
TBLShippingDetails

I have a form
Main form: FRMProductDetails - RecordSource: ProductDetails

If I have a text box named TXTShippingcode and I want to put the entry into a table that the form isn't a record source for (e.g. ShippingDetails) how do I do this?
I presume I have to do a path from the table name to the table field?, I tried the below into the field record path with no success
[TBLShippingDetails]![ShippingCode]
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:23
Joined
Oct 29, 2018
Messages
21,357
Hi. If the two tables are related, have you considered using a subform for the other table?
 

stu_c

Registered User.
Local time
Today, 10:23
Joined
Sep 20, 2007
Messages
489
Hello mate,
yes I have but I would prefer it not in a subform as I have another subform to add in
 

plog

Banishment Pending
Local time
Today, 05:23
Joined
May 11, 2011
Messages
11,611
Its going to require some VBA code, specificallya DoCmd.RunSQL:


Compose an INSERT statement using the value and execute it using the above.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:23
Joined
Oct 29, 2018
Messages
21,357
Hello mate,
yes I have but I would prefer it not in a subform as I have another subform to add in
Interesting comment. Sounds like you will need at least a box to enter the value, so why can't it be a subform? If you're worried about real estate, a subform can be of any size. So, that one box could be the entire subform.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:23
Joined
Feb 19, 2002
Messages
42,970
Since the rules of normalization prohibit storing a piece of data in multiple places, my "spidy" sense always perks up when someone asks how to do this. What is the purpose of storing a piece of data in multiple places?
 

Users who are viewing this thread

Top Bottom