|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Got error displaying data in text box
I created a text box to display a field named "Frequency". The datatype of Frequency in the table is integer. I created a VBA function to translate the value of frequency to be displayed in the text box. The following is my function.
In the control source of the textbox, I set it to "=Display_frequency(Frequency). When I open the form, I got #Error in that field. Anyone knows the reason? I don't know how to find out the Error. ++++++++++++++++++++++++++++++++++++++++++++++ Option Compare Database Option Explicit Public Function Display_Frequency(Frequency As Integer) As String Select Case Frequency Case Frequency = 1 Display_Frequency = "Annual" Case Frequency = 2 Display_Frequency = "Semi-Annual" Case Frequency = 4 Display_Frequency = "Quarterly" Case Frequency = 6 Display_Frequency = "Bi-Monthly" Case Frequency = 12 Display_Frequency = "Monthly" Case Else Display_Frequency = "Other" End Select End Function |
|
#2
|
|||
|
|||
|
This is a stab in the dark but try
=Display_frequency([Frequency]) S- |
|
#3
|
|||
|
|||
|
Thanks. Still got an error.
Infojunkie |
|
#4
|
|||
|
|||
|
I think that sbaxter is right in the suggestion he has made but there is also an error in your code module.
Case Frequency = 1 should be Case 1 and so on through the other lines. |
|
#5
|
|||
|
|||
|
Thanks Stev, I didn't even see that.
S- |
|
#6
|
|||
|
|||
|
This is frustrating, I made the change to Case 1..., and still got the #Error. Is there any way to find out what's the error? I made a breakpoint. But it never stops there. I am new to Access as you can tell. Thanks for your help anyway.
|
|
#7
|
|||
|
|||
|
POst your DB and we will look at it.
If it is to large to post, get yourself a free FTP site with yahoo breifcase and send us a private message with the username and password. S- |
|
#8
|
|||
|
|||
|
I am posting a functioning sample DB you can have a look at.
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Got error displaying data in text box |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|