Page Footer Control

  • Thread starter Thread starter ym
  • Start date Start date
Y

ym

Hello,

In the Page Footer, I have a textbox "txtPage" and its properties sheet
control source = "Page " & [Page] & " of " & [Pages]

But now, I have to add in language manipulation, if its the French language,
the " of" will be displayed as " de" . So, my control source will be
something like "Page " & [Page] & " " & iif(gsLanguage = "E", " of ", " de")
& [Pages] but of course this syntax don't work and I get an error #Name on
the report at runtime.

Does anybody know how can I control this ???
 
ym said:
In the Page Footer, I have a textbox "txtPage" and its properties sheet
control source = "Page " & [Page] & " of " & [Pages]

But now, I have to add in language manipulation, if its the French language,
the " of" will be displayed as " de" . So, my control source will be
something like "Page " & [Page] & " " & iif(gsLanguage = "E", " of ", " de")
& [Pages] but of course this syntax don't work and I get an error #Name on
the report at runtime.


A text box can not refer to a VBA variable.

In this case, I suggest that you create a function in a
standard module that returns the desired word:

Public Function GetOfWord()
Select Case gsLanguage
Case "E"
GetOfWord = " of "
Case "F"
GetOfWord = " de "
Case Else
GetOfWord = " new languge, add case "
End Select
End Function

Then use the function in your expression:

="Page" & [Page] & GetOfWord() & [Pages]
 
Hi Marshall,

This works beautifully.....thank you and appreciate your help....

ym


Marshall Barton said:
ym said:
In the Page Footer, I have a textbox "txtPage" and its properties sheet
control source = "Page " & [Page] & " of " & [Pages]

But now, I have to add in language manipulation, if its the French language,
the " of" will be displayed as " de" . So, my control source will be
something like "Page " & [Page] & " " & iif(gsLanguage = "E", " of ", " de")
& [Pages] but of course this syntax don't work and I get an error #Name on
the report at runtime.


A text box can not refer to a VBA variable.

In this case, I suggest that you create a function in a
standard module that returns the desired word:

Public Function GetOfWord()
Select Case gsLanguage
Case "E"
GetOfWord = " of "
Case "F"
GetOfWord = " de "
Case Else
GetOfWord = " new languge, add case "
End Select
End Function

Then use the function in your expression:

="Page" & [Page] & GetOfWord() & [Pages]
 
Back
Top