Opening form using Sourceobject (1 Viewer)

mtn

Registered User.
Local time
Today, 11:57
Joined
Jun 8, 2009
Messages
54
Hi There,

I have run into a problem I haven't been able to work around. I have a complete database where I open all my form mostly using this type of command: DoCmd.OpenForm "frmOrders".

Now I am trying to redesign my database using a sourceobject where I can open all my forms directly into on the main menu instead of using separate forms.

The challange I seem to be having now is that instead opening my form using this code:

DoCmd.OpenForm "frmOrders", , , , , , Me.txtUser

I want to open my form using:

With Forms("frmMainMenu")!Subform
.SourceObject = "frmOrders"
End With

But I don't know how to pass the openargs (, , , , , , Me.txtUser). It's giving me errors.

How can I resolve this please?

Thanks.
 

DCrake

Remembered
Local time
Today, 11:57
Joined
Jun 8, 2005
Messages
8,632
Are we talking about main forms and sub forms here with master and child links? or are we on a totally different track?

David
 

mtn

Registered User.
Local time
Today, 11:57
Joined
Jun 8, 2009
Messages
54
David thanks for your quick reply. I do not have any master and child links.

All I just wanted was for my form to open inside the sourceobject or subform but with the openargs.

I have attached a scenario of what I am trying to achieve in the attached sample file I found somewhere on the net.

Let me know is you need more explanations please.

Thanks.
 

Attachments

  • AccessChat.zip
    116.8 KB · Views: 94

DCrake

Remembered
Local time
Today, 11:57
Joined
Jun 8, 2005
Messages
8,632
Ok

You need to take all the controls and code from your login form and paste it into the form header of the new form. Or expand the login form then drop the FraCha into the details section of the main form, as a subform. Then set the master and child properites of the subform to TxtUser. You may have to amend some of your code so it interacts correctly with the main and sub form.


David
 

mtn

Registered User.
Local time
Today, 11:57
Joined
Jun 8, 2009
Messages
54
I will try this and revert back but just a quick one please. What is the appropriate code or method of passing openargs using .sourceobject = "frmCha"?

It is very easy to use DoCmd but not with sourceobjetcs.

Thanks.
 

DCrake

Remembered
Local time
Today, 11:57
Joined
Jun 8, 2005
Messages
8,632
Me.Subform.OpenArguments = "???" I think. Never use them actually.
 

Pauldohert

Something in here
Local time
Today, 03:57
Joined
Apr 6, 2004
Messages
2,101
You may have to be careful - that other users will be able to change the source object.

ie if they have no "Modify Design" or "Administrer" permissions.
 

mtn

Registered User.
Local time
Today, 11:57
Joined
Jun 8, 2009
Messages
54
Attached is a sample of my user interface which will be deployed as an Mde file.
 

Attachments

  • page1.gif
    page1.gif
    42.8 KB · Views: 119

Users who are viewing this thread

Top Bottom