![]() |
|
#1
|
|||
|
|||
![]()
Thanks for the reply. The spaces on the form say {FORMTEXT} (some say {FORMCHECKBOX}, but I never have been able to get those to work. I think that problem was in how to code it in Access VBA).
In normal view, I can right-click on one of the spaces to bring up Properties. That opens a Text Form Field Options window. The bottom half of this window has a Field Settings area. Under Bookmark: is the name given to this field/bookmark (EDate), which led me to believe it was a bookmark and not a Field. I've look up again how to insert fields on the new form. I clicked Insert, Quick Parts, then Field, but I'm not sure what category to use in this case. The ones I have tried still don't look like what is on the old document. They look more like formulas rather than text from a database. If you have an easily explained method I could use, that would probably help me sooner and with less confusion than the help files. Thanks again for your response. Edit: Here is the code from the Access form that does work if it might help; Code:
Private Sub ChkYInj_GotFocus() 'If the "Yes" box is checked indicating there was an injury, the Injury Report form opens Const DOC_PATH As String = "T:\Injury Reporting\" Const DOC_NAME As String = "Injury Form.doc" Dim appWord As Word.Application Dim doc As Word.Document Dim rst As ADODB.Recordset Dim strSQL As String On Error Resume Next Set appWord = GetObject(, "Word.application") If Err = 429 Then Set appWord = New Word.Application Err = 0 End If With appWord Set doc = .Documents(DOC_NAME) If Err = 0 Then If MsgBox("Do you want to save a copy of this form?", vbYesNo) = vbYes Then .Dialogs(wdDialogFileSaveAs).Show End If doc.Close False End If On Error Goto ErrorHandler Set doc = .Documents.Open(DOC_PATH & DOC_NAME, , True) Set rst = New ADODB.Recordset With doc .FormFields("name").Result = Nz(Forms!Input![J1Name]) .FormFields("date").Result = Nz(Forms!Input![NDate]) .FormFields("details").Result = Nz(Forms!Input![NDesc]) End With .Visible = True .Activate End With Set rst = Nothing Set doc = Nothing Set appWord = Nothing Exit Sub ErrorHandler: MsgBox Err & Err.Description End Sub Last edited by macropod; 06-16-2011 at 04:57 PM. Reason: Added code tags & formatting |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
WilfredoMolina | Office | 1 | 10-10-2010 06:47 AM |
Can you actually write HTML and CSS in a word document and send it as an html page | jackaroo | Word | 0 | 07-12-2010 07:49 AM |
Create a Custome Form and export data to Access | ashleybyrdnc | Office | 0 | 03-05-2010 09:41 AM |
Can I fill in Word document from Access table and/or query? | slim_jim_56 | Word Tables | 0 | 10-03-2007 01:59 PM |
Microsoft Access - Form For Sales Analysis | kennyharrill | Office | 0 | 09-15-2005 08:49 AM |