INSERT INTO and subforms

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Hi all,

i have a mainform (Order) with a subform on it listing products ordered
(subOrders)..

I have an airconditioner calculator form that basically accepts some
variables (house/premise attributes, size of room etc), and outputs suitable
airconditioner products. Depending on the airconditioner the user selects,
i wish for the program to automatically insert the selected product into the
subOrder form on the main Orders form. I have managed to do this, but only
when a particular circumstance occurs:

I must select (not insert any data) the first textbox in my datasheet. Once
this occurs, the INSERT INTO statement ran from the other form works fine.
This is really weird. I have tried using the setfocus method from code to
'simulate' this, but to no avail. I am really stuck between a rock and a
hard place.

i have also tried playing with a recordsetclone approach as well.....

can anybody help me please??????????????????????????

Regards,
Bill
 
A subform reference looks like:


Forms!FormName!SubformControlName.Form!TextBoxName

To explain it:

Forms - this is a reference to the Forms collection

FormName - the name of the main form containing the subform contol [In
square brackets] if the words have a space.

SubformControlName - The subform is not a form, but a control on a form. Use
the control's name [In square brackets] if the words have a space.

Form - The form property of the subform control. Use the dot (.) to set off
a method or property.

TextBoxName - The name of the text box control [In square brackets] if the
words have a space.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top