Conditional Compilation

mlai08

Registered User.
Local time
Today, 12:02
Joined
Dec 20, 2007
Messages
110
I have splitted a database into forntend and backend. They share similar codes in their forms. However, I want to hide some fields when a form is loaded in the frontend. Instead on changing the code in the frontend, I want to use Conditional Compilation Constant as follows:

'Conditional Compilation Constants (specified on the Tools-Options interface)
'gcccFrontEnd Is this the front-end of the database?
' gcccFrontEnd = 0 not the front
' gcccFrontEnd <> 0 is the front

In the codes of the form:

#If gcccFrontEnd Then

With Me
.cboFindEmp.Visible = False
.cmdReturnToMenu.Visible = False
.NavigationButtons = False
End With

#End If

I recall that I could refer the frontend database as constant gcccFrontEnd under Tools/Options in Access 97 but no longer be able to find where I can do that in Access 2000.

Does anyone have an idea on this?

Thanks

Mike
 
In a module you could put:

Global Const gcccFrontEnd = False

Or = True if it is the Front End.

However - why is there a form in your back end? The only thing in a back end should be data tables.
 
odin1701, thanks for your help. That is a good simple alternative.

I keep forms in a password-protected backend to allow an administrator to perform similar form functions plus other features not included in the frontend.

Mike
 

Users who are viewing this thread

Back
Top Bottom