wackywoo105
Registered User.
- Local time
- Today, 09:30
- Joined
- Mar 14, 2014
- Messages
- 203
I'm using the following code to populate the columns in an excel spreadsheet with the field name from an access form.
What I also want to do is move onto the next line of the spreadsheet and input the values of those fields for the current open form. Of course the code below doesn't work. Can anyone help with what to use?
Code:
Dim count As Integer: count = 1
For Each fld In db.TableDefs!LabOrders.Fields
oXLSheet.Cells(1, count).Value = fld.Name
count = count + 1
Next
What I also want to do is move onto the next line of the spreadsheet and input the values of those fields for the current open form. Of course the code below doesn't work. Can anyone help with what to use?
Code:
count = 1
Dim LastRow As Integer
LastRow = oXLSheet.UsedRange.Rows.count + 1
For Each fld In db.TableDefs!LabOrders.Fields
oXLSheet.Cells(LastRow, count).Value = fld.Value
count = count + 1
Next
Last edited: