How to Emulate Split Form

In trying to set the single form subformcontrol, the main form's text box I created isn't in the list because the text box is on the main form not the subformcontrol.
 
I guess you are trying Galaxiom's code
Recommend you instead use Mark's code as its even simpler
Have a look at the one I posted based on his code. See post #17
 
I Mark's code, here's how I substituted my objects:

Code:
Private Sub Form_Open(Cancel As Integer)

'   This is the main form open event handler
    
    Me.RecordSource = "tblAutoMtce"  'set the recordsource of the main form
    Me.frmAutoMtceSub.SourceObject = "fTestDataDS" 'load datasheet ubform w/ blank RecordSource
    Set Me.frmAutoMtceSub.Form.Recordset = Me.Recordset 'set subform recordset to same object as main form's

End Sub

I'm not sure about line 2
Code:
  Me.frmAutoMtceSub.SourceObject = "fTestDataDS"      'load datasheet subform w/ blank RecordSource

Right now I'm getting error 2101:
"The setting you entered isn't valid for this property."
 
You need to use the name of your subform, not "fTestDataDS." That line of code loads a form into the subform control. Make sure the RecordSource of the subform is blank, or Access will try to set the LinkMasterFields and LinkChildFields properties of the subform control.
Mark
 
Aha!

Worked Well.

So many ways to do things in Access.

Thanks again to all for the help.
James
 
Hi all, I have the same problem, just with me I can not get my textbox to display the link field from my datasheet table. I could not even get to linking parent and child. My link field is a text and not a number, does that make a difference?
 
Gismo - sorry but I don't see how your post relates to this thread.
Maybe you need to explain it again
 
Hi, I tried to have 2 splitforms on a tab but apparently you can not that way so I tried to emulate the split form, new blank form with my single form and my continuous form with a textbox in the main for as the link between main and continuous form, then link 3rd form, single form, with parent child. My problem is that the textbox does not display my primary field. Record selected in continuous form must reflect in the single form. I tried just about every which way around
 
Hi Colin, I tried everything I can think of.
still can not get the textbox to display record
I have attached a screenshot
 

Attachments

  • Capture.JPG
    Capture.JPG
    69.9 KB · Views: 199
Have you looked at my example db?

Two things
1. In the emulated split form, the two parts have the same record source but they must not be linked.
2. That error normally means the field does not exist in the recordsource
 
Yes I looked at your example. I am still trying to get the textbox to display my datasheet record, have not linked anything as yet, yes both are from the same table, same data. this is my code in the textbox: =[Forms]![Task Definition - Master - DataSheet]![AutoNumber]
 
Hi All, I am still not getting my splitform emulation to work. Please if someone could have a look at my sample attached, it would be much appreciated
 
Colin,

Any chance you could upload that DB in a 2007 friendly format please.?

Now that really is easy!
It took 2 minutes - mostly to remove the garbage code I had tried earlier

I used a continuous subform as I'd already created that

Attached a simple db with an emulated split form using Mark's code for the benefit of the OP (JamesJoey)

I'm sure he'll be back here passing on his thanks

Many thanks to both Greg & Mark for their contributions - I only wish you'd got involved earlier ...
 
Hi Colin, I just copied from my DB, it is 2007
 
Its in sample databases
See link in post #29

It was done in Access 2010 & AFAIK should be fine in 2007 but I don't use that.
Otherwise suggest saving it as an mdb
 

Users who are viewing this thread

Back
Top Bottom