G
Guest
Hi!,
I am fairly new to ACCESS and have had help to get me this far with the
problem and thought I had figured it out but I am having to ask for some
assistance to get this "DoCmd.RunSQL Insert into" script to run using data
from a subform.
Below is the command I am using from a button on a form to add a line to my
inventory table. The data (product# and quantity) for the added line will
come from data appearing on a sub-form. It runs correctly but it is not
pulling the data from the sub-form as when the command is activated from the
button 2 boxes popup each with the script showing below for each textbox
asking for the data that is on the form. If I input the data by keybord the
Insert command works perfectly!!! But I just cannot get it to pull the data
from the form. Any assistance would be greatly appreciated with getting this
figured out...
Mainform is named {pohdrecv}
subform on that mainform is named {mmpolnsub}
textboxes on {mmpolnsub} that the data will come from are named {prodno} and
{received}
Also the script below is a single line before copying it here to this message.
Here is the VB command I am using:
DoCmd.RunSQL "INSERT INTO tbl_inventory ([product#], [quantity])VALUES
([forms]![pohdrecv]![mmpolnsub].[form]![prodno],[forms]![pohdrecv]![mmpolnsub].[form]![received])"
And as Always THANKS IN ADVANCE!!!!
Chip
I am fairly new to ACCESS and have had help to get me this far with the
problem and thought I had figured it out but I am having to ask for some
assistance to get this "DoCmd.RunSQL Insert into" script to run using data
from a subform.
Below is the command I am using from a button on a form to add a line to my
inventory table. The data (product# and quantity) for the added line will
come from data appearing on a sub-form. It runs correctly but it is not
pulling the data from the sub-form as when the command is activated from the
button 2 boxes popup each with the script showing below for each textbox
asking for the data that is on the form. If I input the data by keybord the
Insert command works perfectly!!! But I just cannot get it to pull the data
from the form. Any assistance would be greatly appreciated with getting this
figured out...
Mainform is named {pohdrecv}
subform on that mainform is named {mmpolnsub}
textboxes on {mmpolnsub} that the data will come from are named {prodno} and
{received}
Also the script below is a single line before copying it here to this message.
Here is the VB command I am using:
DoCmd.RunSQL "INSERT INTO tbl_inventory ([product#], [quantity])VALUES
([forms]![pohdrecv]![mmpolnsub].[form]![prodno],[forms]![pohdrecv]![mmpolnsub].[form]![received])"
And as Always THANKS IN ADVANCE!!!!
Chip