Hi,
I have a parent form, called RepontEntry_frm, and a subfom on it, called SSL_frm. The parent form has no record source and contains unbound controls. It is used to merely populate some fields on a report that will be printed.
From the parent form I am able to import data by linking a .dbf file and calling it CurrentReport_tbl, which is the data source for the subform. This works just fine.
My problem is that I cannot get the subform to refresh and show the newly linked data without first closing then reopening the parent form (F9 and Shift+F9 don't seem to work on the subform whether or not it has focus). Is there a way to refresh the subform without closing and reopening the parent form, or would it be better to use two independent forms (i.e. no subform)?
Here is a part of the code I am using to import the data:
Dim DB As String
Me.SSL_frm.Visible = False
With Me.cdlgOpen
.InitDir = ExistingDir
.CancelError = True
.Filter = "DBF Files (*.dbf)|*.dbf|"
.ShowOpen
DB = Right(.fileName, 12)
End With
DoCmd.DeleteObject acTable, "CurrentReport_tbl"
DoCmd.TransferDatabase acLink, "dBase IV", "C:\AtlasGIS\Data\_Reports", acTable, DB, "CurrentReport_tbl", 0
Me.SSL_frm.Requery
Me.SSL_frm.Visible = True
Another interesting point is that Access will not let me import the data, only link it. Access gives me an error that it cannot lock the object if I use the acImport feature.
Thanks in advance for you help,
Rich.
I have a parent form, called RepontEntry_frm, and a subfom on it, called SSL_frm. The parent form has no record source and contains unbound controls. It is used to merely populate some fields on a report that will be printed.
From the parent form I am able to import data by linking a .dbf file and calling it CurrentReport_tbl, which is the data source for the subform. This works just fine.
My problem is that I cannot get the subform to refresh and show the newly linked data without first closing then reopening the parent form (F9 and Shift+F9 don't seem to work on the subform whether or not it has focus). Is there a way to refresh the subform without closing and reopening the parent form, or would it be better to use two independent forms (i.e. no subform)?
Here is a part of the code I am using to import the data:
Dim DB As String
Me.SSL_frm.Visible = False
With Me.cdlgOpen
.InitDir = ExistingDir
.CancelError = True
.Filter = "DBF Files (*.dbf)|*.dbf|"
.ShowOpen
DB = Right(.fileName, 12)
End With
DoCmd.DeleteObject acTable, "CurrentReport_tbl"
DoCmd.TransferDatabase acLink, "dBase IV", "C:\AtlasGIS\Data\_Reports", acTable, DB, "CurrentReport_tbl", 0
Me.SSL_frm.Requery
Me.SSL_frm.Visible = True
Another interesting point is that Access will not let me import the data, only link it. Access gives me an error that it cannot lock the object if I use the acImport feature.
Thanks in advance for you help,
Rich.