[AccessD] JIT SubForms

Jim Lawrence accessd at shaw.ca
Tue Aug 28 11:45:33 CDT 2007


Hi Bryan:

This is just a SWAG but would something like the following work?

Me.fmMainForm.sfmSubForm.SourceObject = "sfmShiftReport"

HTH
Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell
Sent: Tuesday, August 28, 2007 9:28 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] JIT SubForms

I'm finally back in the development mode, from management mode, and
have run into a problem with some JIT sub forms.

I have a SubForm Control that can hold 1 of 5 subforms. I set the
SourceObject, LinkChildFields and LinkMasterFields in code to change
the subform.

If I use one of the 3 that are similar (display, add and edit
version), everything works just fine, but when I try and switch to a
subform that is completely different, I get Parameter requests and
errors popping up.

It first asks for parameter that is one of the link fields (Child
IIRC)., When I cancel the parameter request dialog I get an error 2101
The Setting you entered isn't valid for this property. The code
actually DOES change it, but gives an error.

This is the actual code I use:

  Me.sfmSubForm.SourceObject = "sfmShiftReport"
  Me.sfmSubForm.LinkChildFields = "ShiftReportDate"
  Me.sfmSubForm.LinkMasterFields = "txtShiftReportDate"

I've tried setting all of these to an empty string first. No Joy, the
error still appears. I've tried various orders of setting things, and
"unsetting" them. Still get the error.

Does anyone have any insight to why this isn't working for me?

Thanks,

-- 
Bryan Carbonnell - carbonnb at gmail.com
Life's journey is not to arrive at the grave safely in a well
preserved body, but rather to skid in sideways, totally worn out,
shouting "What a great ride!"
-- 
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