|
-
Jan 14th, 2004, 07:10 PM
#1
Thread Starter
Hyperactive Member
Subforms: this should be easy [RESOLVED]
I'm working with VBA/Access 2000.
I have a frmForm and a frmSubform. The subform is independant, no child link and all. It shows a customer's info (name, adress and so on).
I want the subform to go to a newrecord. I've tried the following "GoToRecord" method, with no succes:
DoCmd.GoToRecord acDataForm, Forms!frmForm.frmSubform.Form.Name, acNewRec
I get the error: "The Object 'frmCustomer' isn't open".
...so it gets the form name alright, but because it's in a subform (?), it says it isn't opened.
Any idea? Thanks
Last edited by Krass; Jan 14th, 2004 at 08:12 PM.
Chris
-
Jan 14th, 2004, 07:32 PM
#2
Frenzied Member
Well, is the form open? Have you loaded it?
-
Jan 14th, 2004, 07:35 PM
#3
Thread Starter
Hyperactive Member
Yes it is opened.
The customer's file is all there in the subform... I can even interact with it. I don't know how to reach a "new record".
Keeps on saying the form isn't opened. It is actually opened, but throught the subform - it's the only (and important, it seems) difference.
-
Jan 14th, 2004, 08:12 PM
#4
Thread Starter
Hyperactive Member
Problem solved.
I solved my problem. VB Help comes in handy sometimes:
If you leave the objecttype and objectname arguments blank (the default constant, acActiveDataObject, is assumed for objecttype), the active object is assumed.
So I replaced:
DoCmd.GoToRecord acDataForm, Forms!frmForm.frmSubform.Form.Name, acNewRec
by:
DoCmd.GoToRecord , , acNewRec
Works good.
-
Jan 15th, 2004, 04:48 AM
#5
Fanatic Member
Have you ever have code just stop working while dealing with sub forms? I just can't get to the bottom of it.
-
Jan 15th, 2004, 12:27 PM
#6
Thread Starter
Hyperactive Member
I'm not using subforms the way it's meant to be used. I simply added a subform control to an old application so I could use a listbar on the left of the main window.
That way, clicking the listbar just selects the form to be displayed in the subform.
I'm playing with 2 subforms, making the navigation real quick from one screen (subform) to another only by playing with the "visible" property.
No problem so far.
-
Jan 15th, 2004, 12:41 PM
#7
Fanatic Member
I do that too, I have all the navigation on a sub form... it's the bound one's that are Ping about on me... thanks tho'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|