I have a form kicking off an INSERT query. I need to check another table for a matching value and use a field from that table as the value for one of the fields in my insert.
Table 1 (insert from form)
PLN_NUM
SLN_NUM
Table 2
PLN_NUM
SLN_NUM
I need to do something like:
Can somebody help with how to make this insert?
Thanks
Table 1 (insert from form)
PLN_NUM
SLN_NUM
Table 2
PLN_NUM
SLN_NUM
I need to do something like:
Code:
INSERT INTO [Table 1] (PLN_NUM, SLN_NUM) VALUES (fld_PLN_NUM, (SELECT SLN_NUM FROM [Table 2] WHERE PLN_NUM = fld_PLN_NUM))
Thanks
Comment