[AccessD] Create link between unbound mainform and subform

paul.hartland at fsmail.net paul.hartland at fsmail.net
Fri Oct 24 06:27:37 CDT 2003


quickly off the top of my head, what you could do is something like below......
in the OnCurrent event of the main (unbound) form, have something like below :
Forms![mainformname].Form![subformname].RecordSource = "SELECT FROM tableforsubform WHERE tableforsubform.uniqueid = " & me.uniqueid 
Forms![mainformname].Form![subformname].Refresh ' note this may need to be changed to Requery
Let me know if you have any problems, or even send a sample copy of your database and I will have a look.

Paul Hartland




Message date : Oct 24 2003, 12:15 PM 
>From : Sad Der 
To : Acces User Group 
Copy to : 
Subject : [AccessD] Create link between unbound mainform and subform 
Hi group, 

I'm using A2K. I've got an unbound form (fDetailMI). 
On this form I've got a subform (fComments). 

The subform is bound to the table tblComments 
The mainform is not bound. 

How can I link the subform to display the data for the 
current record at the main form? 

I already tried using a query as a record source for 
the subform. The query has a parameter that references 
an ID on the main form. Somehow this doesn't work? 

Any ideas? 

Regards, 

SD 



__________________________________ 
Do you Yahoo!? 
The New Yahoo! Shopping - with improved product search 
http://shopping.yahoo.com 
_______________________________________________ 
AccessD mailing list 
AccessD at databaseadvisors.com 
http://databaseadvisors.com/mailman/listinfo/accessd 
Website: http://www.databaseadvisors.com 


More information about the AccessD mailing list