|
|
|
Вопрос остался открытым!
|
|||
|---|---|---|---|
|
#18+
Как преобразовать данный код для отображения данных во встроенном в форму объекте Excel.sheet.8. Может есть другие более практичные варианты? Рад всем предложениям!!! Dim rst As DAO.Recordset Dim XL As New Excel.Application Dim x As Integer Set rst = CurrentDb.OpenRecordset("table1") XL.Workbooks.Open "c:\1.xls" XL.Worksheets(1).Select XL.Visible = True rst.MoveFirst x = 5 While Not rst.EOF XL.Range("A" & CStr(x) & "").Select XL.ActiveCell.Formula = rst.Fields("Field1").Value XL.Range("B" & CStr(x) & "").Select XL.ActiveCell.Formula = rst.Fields("Field2").Value XL.Range("C" & CStr(x) & "").Select XL.ActiveCell.Formula = rst.Fields("Field3").Value XL.Range("D" & CStr(x) & "").Select XL.ActiveCell.Formula = rst.Fields("Field4").Value XL.Range("E" & CStr(x) & "").Select XL.ActiveCell.Formula = rst.Fields("Field5").Value XL.Range("F" & CStr(x) & "").Select XL.ActiveCell.Formula = rst.Fields("Field6").Value XL.Range("G" & CStr(x) & "").Select XL.ActiveCell.Formula = rst.Fields("Field7").Value XL.Range("H" & CStr(x) & "").Select XL.ActiveCell.Formula = rst.Fields("Field8").Value x = x + 1 rst.MoveNext Wend ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2003, 00:43 |
|
||
|
Вопрос остался открытым!
|
|||
|---|---|---|---|
|
#18+
Буквы A-H загнать в 8-мерный массив и брать из него, вместо rst.Fields("Field...").value писать rst.Fields(i) и устроить цикл по i=1,8. Будет немного короче. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2003, 09:00 |
|
||
|
Вопрос остался открытым!
|
|||
|---|---|---|---|
|
#18+
While Not rst.EOF XL.Range("A" & x).Value = rst.Fields("Field1").Value XL.Range("B" & x).Value = rst.Fields("Field2").Value XL.Range("C" & x).Value = rst.Fields("Field3").Value x = x + 1 rst.MoveNext Wend А еще посмотри функцию CopyFromRecordset ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2003, 09:11 |
|
||
|
Вопрос остался открытым!
|
|||
|---|---|---|---|
|
#18+
Объясни подробнее, пожлуйста... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2003, 09:14 |
|
||
|
Вопрос остался открытым!
|
|||
|---|---|---|---|
|
#18+
Что прописать в блоке: Dim rst As DAO.Recordset Dim XL As New Excel.Application Dim x As Integer Set rst = CurrentDb.OpenRecordset("table1") XL.Workbooks.Open "c:\1.xls" XL.Worksheets(1).Select XL.Visible = True rst.MoveFirst x = 5 ????? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2003, 09:21 |
|
||
|
Вопрос остался открытым!
|
|||
|---|---|---|---|
|
#18+
Имейте совесть!!! Не скупитесь на иформацию!!! Помогите, пожалуйста!!! :) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2003, 09:44 |
|
||
|
Вопрос остался открытым!
|
|||
|---|---|---|---|
|
#18+
This example copies the field names from a DAO Recordset object into the first row of a worksheet and formats the names as bold. The example then copies the recordset onto the worksheet, beginning at cell A2. For iCols = 0 to rs.Fields.Count - 1 ws.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name Next ws.Range(ws.Cells(1, 1), _ ws.Cells(1, rs.Fields.Count)).Font.Bold = True ws.Range("A2").CopyFromRecordset rs ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.07.2003, 10:15 |
|
||
|
|

start [/forum/topic.php?fid=45&fpage=1778&tid=1680543]: |
0ms |
get settings: |
6ms |
get forum list: |
14ms |
check forum access: |
6ms |
check topic access: |
6ms |
track hit: |
63ms |
get topic data: |
11ms |
get forum data: |
4ms |
get page messages: |
38ms |
get tp. blocked users: |
1ms |
| others: | 213ms |
| total: | 362ms |

| 0 / 0 |
