In my works microsoft access database I have built a button to export data from a specific form to an excel document. The excel document has it's own calculations built in to pull/distribute the data from the database when the excel document is opened by the click button. As of Friday the code was working perfectly and was pulling everything as expected.
Today when I came in, the button is no longer pulling the field 'Customer #' to the document, it instead duplicates the information from 'Install Customer #' So for instance, a record with the following information:
Customer Name: Glowie
Order #: 1
INSTALL Customer #: 99
Customer #: 100
The above information would pull to excel with the following 4 fields:
A2 = Glowie
B2 = 1
C2 = 99
D2 = 99
The code is as follows in access:
Private Sub Command8_Click()
Dim appExcel As Excel.Application
Dim wrkBook As Excel.Workbook
Set appExcel = New Excel.Application
Set wrkBook = appExcel.Workbooks.Open(CurrentProject.Path & "\Formula.xls")
appExcel.Visible = True
wrkBook.Worksheets("Data").Activate
With wrkBook.ActiveSheet
.Range("A2").Value = [Customer Name]
.Range("B2").Value = [Order #]
.Range("C2").Value = [INSTALL Customer #]
.Range("D2").Value = [Customer #]
.Columns("A:H").AutoFit
End With
End Sub
Please advise why the code would be pulling INSTALL Customer # to C2 and D2.
Thank you!
Today when I came in, the button is no longer pulling the field 'Customer #' to the document, it instead duplicates the information from 'Install Customer #' So for instance, a record with the following information:
Customer Name: Glowie
Order #: 1
INSTALL Customer #: 99
Customer #: 100
The above information would pull to excel with the following 4 fields:
A2 = Glowie
B2 = 1
C2 = 99
D2 = 99
The code is as follows in access:
Private Sub Command8_Click()
Dim appExcel As Excel.Application
Dim wrkBook As Excel.Workbook
Set appExcel = New Excel.Application
Set wrkBook = appExcel.Workbooks.Open(CurrentProject.Path & "\Formula.xls")
appExcel.Visible = True
wrkBook.Worksheets("Data").Activate
With wrkBook.ActiveSheet
.Range("A2").Value = [Customer Name]
.Range("B2").Value = [Order #]
.Range("C2").Value = [INSTALL Customer #]
.Range("D2").Value = [Customer #]
.Columns("A:H").AutoFit
End With
End Sub
Please advise why the code would be pulling INSTALL Customer # to C2 and D2.
Thank you!