Enable/disable navigation button on form load (1 Viewer)

jimbo45

New member
Local time
Yesterday, 16:40
Joined
Mar 26, 2013
Messages
2
I'm fairly new to Access, so bear with me here..

Basically I want to put a code in the "on load" event of a form that enables or disables navigation buttons based on a value in a table (the table has 1 record and 1 column).

So if the value is "A", I want to hide navigation buttons on load; if it is "B", I want to show navigation buttons on load.

I know I can set this property in each form, but I have a number of forms that I want to configure at the same time.

My problem is that I don't know how to reference the value in the table.

Any help is appreciated

Thanks in advance!
 

CJ_London

Super Moderator
Staff member
Local time
Today, 00:40
Joined
Feb 19, 2013
Messages
16,612
Assuming you are bringing through the A/B value in your form recordset

The code (put in your current event, not load event)

Code:
Mybuttonname.enabled=[YourABValue]="B"
 

jimbo45

New member
Local time
Yesterday, 16:40
Joined
Mar 26, 2013
Messages
2
Hi CJ - Thanks for the quick reply!

The A/B value is actually from another table called dbo_config, while the form recordset is a table called dbo_component.

Any ideas?

Thanks
 

CJ_London

Super Moderator
Staff member
Local time
Today, 00:40
Joined
Feb 19, 2013
Messages
16,612
Easiest way would be to use dlookup - you'll need to change naems to suit and this can go in the load event

Code:
Mybuttonname.enabled=dlookup("BType","dbo_config","dbo_component = " & FrmRecordSetID)="B"
 

Users who are viewing this thread

Top Bottom