Add criteria to a append query

B

Barry A&P

I am trying to add criteria to a append query, I was able to use Is Not Null
in my queries Criteria under F_Subs Serialnumber so records that have a blank
SN are not appended but i cant figure out how to put =
Me!T_Main.SerialnumberID in the criteria for the T_Sub's ParentSNID

I have a form F_Main that displays info for a assembly The form is Bound to
F_SerialNumbers with PartID, SerialNumberID, & PartName.

I also have a Subform datasheet F_Sub that Has ParentPNID, and ParentSNID
Bound to a Table T_InputTemplates and Unbound Fields, Serialnumber,
InstallDate, & InstallTime.

F_Sub's ParentPNID is linked to F_Main's SerialNumberID

I have a button on F_Main that runs a query
stDocName = "APPEND SN"
DoCmd.OpenQuery stDocName, acNormal, acEdit

I am trying to append ParentSNID, SerialNumber, Installdate, & Installtime
from My T_InputTemplates to my T_Serialnumbers but only the records that
match the assembly that is viewed on my F_Main..

Any help would be greatly appreciated..

Thanks
 
A

Allen Browne

"Me" works only in the context of VBA code.
Use a full reference to the control, e.g.:
[Forms].[YourMainForm].[Form].[YourSubformControlName].[YourTextBoxName]
 
B

Barry A&P

Thank you allen
Got it with
[Forms]![F_MainInput_AZ]![SerialNumberID]
In criteria

Allen Browne said:
"Me" works only in the context of VBA code.
Use a full reference to the control, e.g.:
[Forms].[YourMainForm].[Form].[YourSubformControlName].[YourTextBoxName]

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Barry A&P said:
I am trying to add criteria to a append query, I was able to use Is Not
Null
in my queries Criteria under F_Subs Serialnumber so records that have a
blank
SN are not appended but i cant figure out how to put =
Me!T_Main.SerialnumberID in the criteria for the T_Sub's ParentSNID

I have a form F_Main that displays info for a assembly The form is Bound
to
F_SerialNumbers with PartID, SerialNumberID, & PartName.

I also have a Subform datasheet F_Sub that Has ParentPNID, and ParentSNID
Bound to a Table T_InputTemplates and Unbound Fields, Serialnumber,
InstallDate, & InstallTime.

F_Sub's ParentPNID is linked to F_Main's SerialNumberID

I have a button on F_Main that runs a query
stDocName = "APPEND SN"
DoCmd.OpenQuery stDocName, acNormal, acEdit

I am trying to append ParentSNID, SerialNumber, Installdate, & Installtime
from My T_InputTemplates to my T_Serialnumbers but only the records that
match the assembly that is viewed on my F_Main..

Any help would be greatly appreciated..

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top