I'm tryng to send a form using access vba.

i have an outlook form put value on fields that comes from my database then send the form.

the problem is when i received the email..the form fields/controls has no value.

here's my sample code.have just put some string on it not the actual records.

VB Code:
  1. Sub Transfer_ToMail()
  2.     Dim oApp As Outlook.Application
  3.     Dim oMsg As Outlook.MailItem
  4.    
  5.     Dim oInspector As Outlook.Inspector
  6.     Dim oPages As Outlook.Pages
  7.     Dim oPage As Object
  8.     Dim oControls As Object
  9.     Dim oControl As Object
  10.    
  11.     Set oApp = New Outlook.Application
  12.     Set oMsg = oApp.CreateItemFromTemplate("C:\Template\FORM_TEMP.oft")
  13.     If Not oMsg Is Nothing Then
  14.         Set oInspector = oMsg.GetInspector
  15.         Set oPages = oInspector.ModifiedFormPages
  16.         Set oPage = oPages("Email Notification")
  17.         Set oControls = oPage.Controls
  18.        
  19.         Set oControl = oControls("FIELDNAME1")
  20.         oControl.Value = "AAA-AA"
  21.        
  22.         Set oControl = oControls("FIELDNAME2")
  23.         oControl.Value = "COMPANY"
  24.        
  25.         'oMsg.Display vbModal
  26.         oMsg.To = "Gates, Bill
  27.         oMsg.Send
  28.        
  29.     Else
  30.         MsgBox "Couldnt find your template!"
  31.     End If
  32.    
  33.    
  34.     Set Inspector = Nothing
  35.     Set Pages = Nothing
  36.     Set Page = Nothing
  37.     Set Controls = Nothing
  38.     Set Control = Nothing
  39.        
  40.     Set oMsg = Nothing
  41.     oApp.Quit
  42.     Set oApp = Nothing
  43. End Sub