aziz rasul
Active member
- Local time
- Today, 16:21
- Joined
- Jun 26, 2000
- Messages
- 1,935
I have created a database with only one table and one module.
The table contains two fields, ID & Field1(this is a memo field). Field1 simply contains text and includes a 5-digit number at random within the text. The purpose of the module or code is to extract the 5-digit number in an unbound text box on a form based on the table. In the module I have copied and pasted the following function (which appeared on this forum recently): -
Function getnumbersFromMemo(X)
Dim y, L As Integer
Dim N As String
L = Len(X)
For y = 1 To L
If IsNumeric(Mid(X, y, 1)) Then
N = N & Mid(X, y, 1)
End If
Next y
getnumbersFromMemo = Val(N)
End Function
On the unbound text box (control source) I have put in =getnumbersFromMemo([X]). However this only shows #Name? What am I doing wrong. Note that I am a beginner and hence a clear explanation would be appreciated.
The table contains two fields, ID & Field1(this is a memo field). Field1 simply contains text and includes a 5-digit number at random within the text. The purpose of the module or code is to extract the 5-digit number in an unbound text box on a form based on the table. In the module I have copied and pasted the following function (which appeared on this forum recently): -
Function getnumbersFromMemo(X)
Dim y, L As Integer
Dim N As String
L = Len(X)
For y = 1 To L
If IsNumeric(Mid(X, y, 1)) Then
N = N & Mid(X, y, 1)
End If
Next y
getnumbersFromMemo = Val(N)
End Function
On the unbound text box (control source) I have put in =getnumbersFromMemo([X]). However this only shows #Name? What am I doing wrong. Note that I am a beginner and hence a clear explanation would be appreciated.