Hi,
Can anyone please tell me why the following code isn't working?
There is data in a text box, txtRq, on frmMain. There is also a subform on frmMain, frmSubSnt. I would like the text in the txtRq inserted into the table the subform is based on, tblSubSnt. None of my searches resulted in anything working.
The code is executed by clicking a command button on a pop up form called frmPopSnt.
I don't get any errors, nothing is inserted into tblSubSnt.
Dim strCpRq as String
strCpRq = Forms!frmMain!txtRq
strSQL = "INSERT INTO tblSubSnt (SntRq) VALUES('" & strCpRq & "')"
MsgBox strSQL returns
INSERT INTO tblSubSnt (SntRq) VALUES('0812-01')
txtRq is automatically calculated when the user adds a new record to frmMain. Also, I need to allow duplicates.
Any help is greatly appreciated.
Thank you.
v/r,
janet
Can anyone please tell me why the following code isn't working?
There is data in a text box, txtRq, on frmMain. There is also a subform on frmMain, frmSubSnt. I would like the text in the txtRq inserted into the table the subform is based on, tblSubSnt. None of my searches resulted in anything working.
The code is executed by clicking a command button on a pop up form called frmPopSnt.
I don't get any errors, nothing is inserted into tblSubSnt.
Dim strCpRq as String
strCpRq = Forms!frmMain!txtRq
strSQL = "INSERT INTO tblSubSnt (SntRq) VALUES('" & strCpRq & "')"
MsgBox strSQL returns
INSERT INTO tblSubSnt (SntRq) VALUES('0812-01')
txtRq is automatically calculated when the user adds a new record to frmMain. Also, I need to allow duplicates.
Any help is greatly appreciated.
Thank you.
v/r,
janet