Access Subform - append query

cityofdowney

New member
Local time
Today, 14:56
Joined
Dec 20, 2007
Messages
6
How do you pass a primary key to an append query from a subform?

Example:
Main form – Table Subscriber (subscriber-id – primary key)
Linked (subscriber-id (main form) = ot-subscriber-id (subform))
One to many
Sub form - Other residents (ot-othres-id – primary key)
From sub form append history record using primary key by query
With in query criteria – [forms]![other residents subform]![ot-othres-id]

Does not work – The primary key isn’t being passed which shows in the subform. Pop up box appears.
 
[Forms]![Subscriber]![other residents subform]![Form]![ot-othres-id]
 
Thanks but it still does not work

Actual line typed: [forms]![subscriptions form]![other residents subform]![Form]![ot-othres-id]

Pop up box ask for the "enter parameter value". Does it matter if it is a button on the subform and runs through a macro?
 
You should make sure that [other residents subform] is the actual name of the subform CONTAINER control that houses the subform on the main form. If it isn't then you need to use the subform CONTAINER name and not the subform name. The subform container and the subform can share the same name but a lot of the times they don't have the same name, if when you added the subform to the main form you chose to refer to it as a different name when the wizard asked, or when manually adding it to the form.
 
Still not working

Since I did not originally create the access forms, I deleted the subform out and readded the subform. Still getting the sam error. What else do I need to look at?

Thanks
 
Database attached

I hope it works since I had to delete out peoples address. Thanks for helping me.
 

Attachments

Okay, a couple of questions -

1. What is the append query supposed to do and

2. how is it activated? I'm not sure I am seeing what exactly you want it to do.
 
Sorry I forgot to give details

Use the signon form -user (jbenavid) password (test)
Button - subscriptions
find existing record - jones
Subform other residents - (delete button) should move data to history
This where the error is happening.

Query: other resident history append
Marco: subscriptions marco - othhis
 
Paste this into the criteria instead:

[Forms]![subscriptions form]![other residents subform].[Form]![ot-othres-id]

It doesn't look like much different but the dot instead of bang just before the [Form] makes it work.
 
Thank you very much. It is working.

Thank you for taking the time and helping me out.
 
Paste this into the criteria instead:

[Forms]![subscriptions form]![other residents subform].[Form]![ot-othres-id]

It doesn't look like much different but the dot instead of bang just before the [Form] makes it work.

Hello I have a simular problem. I am new to access but find it challanging and rewarding. Looking oat finding a solution to appending data to a subform table by a query but need to deal with the PK of the main table. question is this done at the append query if how?? I am a novice so details are great.

Thanks Bob
 

Users who are viewing this thread

Back
Top Bottom