ACCESS 2003 Use append query to update table from subform

eyes59
eyes59 used Ask the Experts™
on

I have an Append Query that updates unbound text boxes via a SUBMIT command button  from a subform which is nested in a Main form.  I can get the append to work in the subform BUT when I open the main form and hit the subform SUBMIT button I get the parameter values error.  The append query does not work from the Main form.  
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
you might be referencing the subform/and controls incorrectly

to refer to the subform controls from the main form

me.subformControlName.form.controlName

post the codes  that you are using

Author

Commented:
Attached is the append query

The name of the subform is sFrmLogActivities.  The Controlname of the subform on the main form is sFrmActivity
INSERT INTO tblLogActivity ( mmNo, LogDate, LogTime, ActivityDate, SubActivity, Minutes, Details )
SELECT ([Forms].[sFrmLogActivities].[txtmmNo]) AS MMno, ([Forms].[sFrmLogActivities].[txtLogDate]) AS [Log Date], ([Forms].[sFrmLogActivities].[txtLogTime]) AS LogTime, ([Forms].[sFrmLogActivities].[txtSubActivityDate]) AS [Activity Date], ([Forms].[sFrmLogActivities].[cmdbType]) AS SubActivityID, ([Forms].[sFrmLogActivities].[txtMinutes]) AS [Minute], ([Forms].[sFrmLogActivities].[txtDetails]) AS Comments;

Open in new window

Top Expert 2016
Commented:
and how are you calling this from the main form?

try this, change NameOfMainForm with actual name of the main form



INSERT INTO tblLogActivity ( mmNo, LogDate, LogTime, ActivityDate, SubActivity, Minutes, Details )
SELECT ([Forms]![NameOfMainForm]![sFrmLogActivities].Form![txtmmNo]) AS MMno, ([Forms]![NameOfMainForm]![sFrmLogActivities].Form![txtLogDate]) AS [Log Date], ([Forms]![NameOfMainForm]![sFrmLogActivities].Form![txtLogTime]) AS LogTime, ([Forms]![NameOfMainForm]![sFrmLogActivities].Form![txtSubActivityDate]) AS [Activity Date], ([Forms]![NameOfMainForm]![sFrmLogActivities].Form![cmdbType]) AS SubActivityID, ([Forms]![NameOfMainForm]![sFrmLogActivities].Form![txtMinutes]) AS [Minute], ([Forms]![NameOfMainForm]![sFrmLogActivities].Form![txtDetails]) AS Comments;
Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
I am using a macro (OpenQuery  ) to run an append query which is listed above.  

Author

Commented:
resolved
Top Expert 2016

Commented:
any reason why a grade of B?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial