If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do I set a subform variable to the source object of a subform control?
I'm trying to do something like this:
-- Dim sf as subform set sf = forms(mySubFormControl.SourceObject) -- But I keep getting this error: "Microsoft Access can't find the form '(my form name)' referred to in a macro expression or Visual Basic code. please help Anthony |
#2
|
|||
|
|||
How do I set a subform variable to the source object of a subform control?
When a form is being used as a subform, it doesn't actually exist in the
Forms collection. Not only that, but when you declare an object as a subform, you're actually declaring the control that holds the form that's being used as a subform: you don't believe you can assign a form to a subform control. What exactly are you trying to accomplish? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Anthony" wrote in message ... I'm trying to do something like this: -- Dim sf as subform set sf = forms(mySubFormControl.SourceObject) -- But I keep getting this error: "Microsoft Access can't find the form '(my form name)' referred to in a macro expression or Visual Basic code. please help Anthony |
#3
|
|||
|
|||
How do I set a subform variable to the source object of a subform control?
nevermind, I figured it out. I changed the variable type from "form" to
"object" so I can use it for forms AND for subforms. "Douglas J. Steele" wrote in message ... When a form is being used as a subform, it doesn't actually exist in the Forms collection. Not only that, but when you declare an object as a subform, you're actually declaring the control that holds the form that's being used as a subform: you don't believe you can assign a form to a subform control. What exactly are you trying to accomplish? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Anthony" wrote in message ... I'm trying to do something like this: -- Dim sf as subform set sf = forms(mySubFormControl.SourceObject) -- But I keep getting this error: "Microsoft Access can't find the form '(my form name)' referred to in a macro expression or Visual Basic code. please help Anthony |
Thread Tools | |
Display Modes | |
|
|