Yes. Create an append query that appends to the table to which the subform is
bound. It is just like your original post, except that you precede the
control name preceded by "[Forms]!" For its field values, use the values of
the controls on your main form like this:
[Forms]![Form1]![Combo1] or
"ABC" & [Forms]![Form1]![Combo1] to concatenate a string with the contents
of the Combo1 combo box, or
[Forms]![Form1]![Combo1] & [Forms]![Form1]![Combo2] to concatenate the
contents of the two combo boxes, or
[Forms]![Form1]![Combo1] + [Forms]![Form1]![Combo2] to add the contents of
the combo boxes (if numeric)
Call your query something like "CreateSubRecord", and then in the form's
double-click have this:
DoCmd.OpenQuery "CreateSubRecord"
ldiaz said:
I need to create a new record after making doubleClick..
I have not query for this, Do I need to create one ??
--
Lorenzo DÃaz
Cad Technician
Brian said:
Sorry. I thought you wanted to navigate to the next record on the main form
after the double-click event was finished.
Do you just need to create the record on the subform, or do you need to
immediately go to it when finished?
If you just need to create the entry, then simply write an append query on
the table underlying the subform, using the contents of the main form
controls as the values for the fields in the append query. Call the query in
your double-click like this:
DoCmd.OpenQuery "NameOfYourQuery"
:
Hi Brian..thank you for your attention.
I tried your code but it does not work..
Let me explain with more specifics datas:
FormName: MainForm
SubFormName: ModANDSize subform
CODE::::::::::::::::::::::::::::::::::::::::::::::::::::
Private Sub List11_DblClick(Cancel As Integer)
[ModANDSize subform]![Cut Sheet] = [CUTS]
[ModANDSize subform]![ModeloANDsizeInfo] = "G:" & [Combo6].Column(1) & " "
& [List0] & " " & [List2].Column(1) & " " & [List4].Column(1) & "(" &
[List11].Column(1) & ")"
[ModANDSize subform]![Qty] = [List4]
""""ypur Code""
DoCmd.GoToRecord acForm, Me.Name, acNewRec
End Sub
I want a new record in SubForm by making double click in the Form...
Could you help me please.
Thanks.
--
Lorenzo DÃaz
Cad Technician
:
At the end of the DoubleClick event, try this to go to the next record.
DoCmd.GoToRecord acForm, Me.Name, acNext
If you want to go to a new record instead of the next record, try this
instead:
DoCmd.GoToRecord acForm, Me.Name, acNewRec
:
Hi All..Happy New Year 2006
My problem is:
I have a Form with many Datas and a Subform used to capture many records ,
and Making Double click in a field of Form all datas are moved to the
Subform, but I
don't know how change to the new record row after making Doubleclick, and If
I try to make another Doubleclick the modifications is made in the same row.
can someone help me on this please.
Thanks.