Set form's property when opening it

A

Alan T

I would like to open a form by setting some properties:
eg. using
DoCmd.OpenForm "frmEmployee", acNormal, , , acFormAdd, acWindowNormal

setting the record navigator visible/invisible

Is it possible?
 
A

Andy Hull

Hi Alan

You can set the navigation properties immediately after opening the form...

DoCmd.OpenForm "frmEmployee", acNormal, , , acFormAdd, acWindowNormal
Forms![frmEmployee].NavigationButtons = True

or in the forms open even... Me.NavigationButtons = True

If neither of these is suitable, then you could use the OpenArgs argument
like...

DoCmd.OpenForm "frmEmployee", acNormal, , , acFormAdd, acWindowNormal,
"ShowNav"

And then test for this in the forms open event...

If Me.OpenArgs = "ShowNav" then
Me.NavigationButtons = True
Else
Me.navigationButtons = False
End If


Regards

Andy Hull
 
A

Alan T

Hi, yes it works to make the Navigator buttons visible.

Can I also configure the buttons visibility?
I want to allow the user navigate the records but not add records.
Can I disable the * button?

Andy Hull said:
Hi Alan

You can set the navigation properties immediately after opening the
form...

DoCmd.OpenForm "frmEmployee", acNormal, , , acFormAdd, acWindowNormal
Forms![frmEmployee].NavigationButtons = True

or in the forms open even... Me.NavigationButtons = True

If neither of these is suitable, then you could use the OpenArgs argument
like...

DoCmd.OpenForm "frmEmployee", acNormal, , , acFormAdd, acWindowNormal,
"ShowNav"

And then test for this in the forms open event...

If Me.OpenArgs = "ShowNav" then
Me.NavigationButtons = True
Else
Me.navigationButtons = False
End If


Regards

Andy Hull


Alan T said:
I would like to open a form by setting some properties:
eg. using
DoCmd.OpenForm "frmEmployee", acNormal, , , acFormAdd, acWindowNormal

setting the record navigator visible/invisible

Is it possible?
 
M

missinglinq via AccessMonster.com

Again, in the forms open event... Me.ButtonName.Visible = False
 
A

Andy Hull

In the forms open event...

Me.NavigationButtons = True
Me.AllowAdditions = False

will allow navigation but not allow new records (it greys out the *)

Regards

Andy Hull


Alan T said:
Hi, yes it works to make the Navigator buttons visible.

Can I also configure the buttons visibility?
I want to allow the user navigate the records but not add records.
Can I disable the * button?

Andy Hull said:
Hi Alan

You can set the navigation properties immediately after opening the
form...

DoCmd.OpenForm "frmEmployee", acNormal, , , acFormAdd, acWindowNormal
Forms![frmEmployee].NavigationButtons = True

or in the forms open even... Me.NavigationButtons = True

If neither of these is suitable, then you could use the OpenArgs argument
like...

DoCmd.OpenForm "frmEmployee", acNormal, , , acFormAdd, acWindowNormal,
"ShowNav"

And then test for this in the forms open event...

If Me.OpenArgs = "ShowNav" then
Me.NavigationButtons = True
Else
Me.navigationButtons = False
End If


Regards

Andy Hull


Alan T said:
I would like to open a form by setting some properties:
eg. using
DoCmd.OpenForm "frmEmployee", acNormal, , , acFormAdd, acWindowNormal

setting the record navigator visible/invisible

Is it possible?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Open form for add/edit records 2
OpenForm 8
Insert CLientID into popup form 1
recordset issue 6
SetDefault 3
Open Form in Add Mode 1
Unable to add new record 1
Form won't filter unles opened as acDialog 0

Top