Subforms / Command Button / Tabs

D

Dave

Hi



I have a space issue with a form layout in Access 2003 so I need to replace
a subform with a command button which in turn can trigger the removed
subform as it's not often used. The subform would be used to view, edit and
add records.



The button would be placed on a subform called "task" and would trigger
subform "progress" the relationship is a one to many the PK of the Task
table is TaskID and the Progress table PK is ProgressID with a FK of TaskID.



Also has anyone any ideas on how you would use subform on tabs again so the
user could view, edit and add records in a one to many relationship with
referential integrity set.



I have read and experimented around and now confused. Once I get it to
filter I then can't get it to add a new record because of referential
integrity.



Any code examples would be most appreciated.
 
K

kingston via AccessMonster.com

Create a query to be the subform's record source and clear the subform's
relationships with the main form. In other words, replace the built-in
Master-Child reference with a query that performs the same function. Your
query would be something like:

"SELECT ... FROM Progress WHERE (TaskID=" & [Forms]![MainForm]![TaskID] & ")
;"

Then you'd be able to use the form as a subform or an independent form.
You'll just have to be careful when referencing the form during data refresh
(are you referencing the subform control or the form by itself?). HTH
 

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