N
Nick_the_tent
Hi
I can requery a form within access like this:
Dim con As Form
Set con = Form_frm_contactnotes_subform
con.Requery
works fine, but am trying to do the same from a word application, i.e. after
the user has saved a revised document is automatically updated in a
'history' subform.
With Dialogs(wdDialogFileSaveAs)
If .Show = -1 Then
Dim f_name As String
f_name = ActiveDocument.FullName
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim con As Form
Dim strid As String
strtid = ActiveDocument.Variables("vquoteid").Value
Set db = DAO.OpenDatabase("C:\OrderDatabase.mdb")
Set rec = db.OpenRecordset("tbl_Contactnotes")
With rec
..AddNew
!quoteID = ActiveDocument.Variables("vquoteid").Value
!ContactnoteDate = Now()
!ContactNoteCreator = CurrentUser()
!ContactnoteNote = "revised document"
!ContactlinkedDoc = "click here to open the document #" & f_name & "#"
..Update
End With
xxxxxxxxxxxxxxxxxxxxx
this bits not working
Set con = db(Form!frm_contactnotes_subform)
con.Requery
xxxxxxxxxxxxxxxxxxxx
Else
End If
End With
any help would be appreciated
TIA
Nick
I can requery a form within access like this:
Dim con As Form
Set con = Form_frm_contactnotes_subform
con.Requery
works fine, but am trying to do the same from a word application, i.e. after
the user has saved a revised document is automatically updated in a
'history' subform.
With Dialogs(wdDialogFileSaveAs)
If .Show = -1 Then
Dim f_name As String
f_name = ActiveDocument.FullName
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim con As Form
Dim strid As String
strtid = ActiveDocument.Variables("vquoteid").Value
Set db = DAO.OpenDatabase("C:\OrderDatabase.mdb")
Set rec = db.OpenRecordset("tbl_Contactnotes")
With rec
..AddNew
!quoteID = ActiveDocument.Variables("vquoteid").Value
!ContactnoteDate = Now()
!ContactNoteCreator = CurrentUser()
!ContactnoteNote = "revised document"
!ContactlinkedDoc = "click here to open the document #" & f_name & "#"
..Update
End With
xxxxxxxxxxxxxxxxxxxxx
this bits not working
Set con = db(Form!frm_contactnotes_subform)
con.Requery
xxxxxxxxxxxxxxxxxxxx
Else
End If
End With
any help would be appreciated
TIA
Nick