wingforward
Registered User.
- Local time
- Today, 15:24
- Joined
- Nov 24, 2009
- Messages
- 27
I'm trying to use a simple Select statement to get data into a variable to set a field and I have two questions. Is this possible? What am I doing wrong?
'Start Code
Dim strCodeID as String
strCode ID = Me.CodeID
Dim SQLCmd as String
SQLCmd = "SELECT Description FROM tblCodes WHERE CodeID = " & strCodeID & ";"
Dim strResult as String
strResult = DoCmd.RunSQL (SQLCmd)
Me.Description = strResult
'End Code
'Start Code
Dim strCodeID as String
strCode ID = Me.CodeID
Dim SQLCmd as String
SQLCmd = "SELECT Description FROM tblCodes WHERE CodeID = " & strCodeID & ";"
Dim strResult as String
strResult = DoCmd.RunSQL (SQLCmd)
Me.Description = strResult
'End Code