blackbeltrrf
Registered User.
- Local time
- Today, 08:30
- Joined
- May 10, 2007
- Messages
- 13
I have a module in Access 2007 with the code:
Option Compare Database
Option Explicit
Function TitleValue()
If TitleValue = 1 Then
Auto_Title0.Caption = "All Open 'Critical' Priority Work Orders"
End If
If TitleValue = 2 Then
Auto_Title0.Caption = "All Open 'Normal' Priority Work Orders"
End If
End Function
This module will go on with many more "If" statements but condensed here to save space.
This code works fine if I put it in the "Form Load" event procedure but will not work if I create an "Event Procedure" to run the function, Runcode Titlevalue()
What I am trying to do:
I have a lot of Queries that filter a table by a variety of different parameters but I want the output to come back to 1 base form and simply change the title dynamically.
What I have done is in each of the different queries I have just put in an expression to assign each query a different "Titlevalue" number to key off of in my form.
Based on the "TitleValue" from each query I want to change the value of the forms AutoTitle0.
Any help would be greatly appreciated on this as to what I am doing wrong.
Option Compare Database
Option Explicit
Function TitleValue()
If TitleValue = 1 Then
Auto_Title0.Caption = "All Open 'Critical' Priority Work Orders"
End If
If TitleValue = 2 Then
Auto_Title0.Caption = "All Open 'Normal' Priority Work Orders"
End If
End Function
This module will go on with many more "If" statements but condensed here to save space.
This code works fine if I put it in the "Form Load" event procedure but will not work if I create an "Event Procedure" to run the function, Runcode Titlevalue()
What I am trying to do:
I have a lot of Queries that filter a table by a variety of different parameters but I want the output to come back to 1 base form and simply change the title dynamically.
What I have done is in each of the different queries I have just put in an expression to assign each query a different "Titlevalue" number to key off of in my form.
Based on the "TitleValue" from each query I want to change the value of the forms AutoTitle0.
Any help would be greatly appreciated on this as to what I am doing wrong.