Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Trying to update A97 database to A2007
The following is a section of code taken from an A97 database, which I did not create. The purpose of this code is to auto-populate an Excel template with information from Access.
Function PopulateFormFields(strTemplate As String, strPledgee As String, strCustodian As String, strLoc As String) As Boolean
Dim rsTemplateField, rsVariable, rsLookup As Recordset
Dim intIndex, I as Integer
Dim MyFileObj As FileSystemObject
Dim MyFile As TextStream
Dim rs As Recordset
On Error GoTo PopulateFormFields_Err
[color=Green]' Select all fields to be substituted for this Excel template (fields to be inserted will be processed later)[/color]
Set rsTemplateField = CurrentDb.OpenRecordset("SELECT * FROM tblTemplateField WHERE FormName = '"_ & strTemplate & "' AND (InsertCoordinates = Null or InsertCoordinates < 'A1')")
If rsTemplateField.EOF Then
MsgBox "No fields found in template field table for form " & strTemplate & ". Generation of form " & strTemplate & " aborted."
PopulateFormFields = False
The section that begins "Set rsTemplateField" is where this hangs up in A2007. Did some of the VBA language change frmo 97 to 07?
Alternatively, is there an issue with the Excel template being Excel 97-03 instead of 07?
0 · ·