Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on refreshing a subform with newly imported data

Status
Not open for further replies.

RDVeron

Programmer
Sep 27, 2001
4
US
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.
 

Hello


to refer to your subform
forms!RepontEntry_frm.form!SSL_frm.requery

should work

as to the other do you have the error number

regards Jo
 
Sure, the error message Access gives me when I try to use the acImport feature is 3211: The database engine could not lock table 'CurrentReport_tbl' because it is already in use by another person or process.

I changed the reference to the subform, but it still just sits there and does not update the list.

If, however, I make SSL_frm an independent form, not a subform, it seems to work just fine. I have the code close SSL_frm, link to the new data, then re-open SSL_frm. This is an acceptable method, but I would prefer SSL_frm to be a subform if at all possible.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top