Автоматизация учета основных средств на предприятии

If Rec. RecordCount > 0 Then

StrFirmName = Nz (Rec. Fields ("НаименованиеФирмы"). Value, "")

StrFirmOKPO = Nz (Rec. Fields ("ОКПО"). Value, "")

StrGlBuch = Nz (Rec. Fields ("Сотрудник"). Value, "")

StrFirmAddr = Nz (Rec. Fields ("ЮрАдрес"). Value, "")

StrFirmReq = Nz (Rec. Fields ("БанкРе

квизиты"). Value, "")

Else

MsgBox "Общие параметры фирмы не занесены!", vbCritical + vbOKOnly

Exit Sub

End If

Set Rec = Nothing

Set Rec = db. OpenRecordset ("select * from запрос_АктыПриемки where НомерАкт = " & nomer, dbOpenSnapshot)

If Rec. RecordCount > 0 Then

StrRukName = Nz (Rec. Fields ("s_ruk"). Value, "")

StrRukDolzh = Nz (Rec. Fields ("d_ruk"). Value, "")

StrDatePodp = Nz (Rec. Fields ("ДатаПодписи"). Value, Date)

StrOsn = Nz (Rec. Fields ("Основание"). Value, "")

StrDatePriem = Nz (Rec. Fields ("ДатаПриемки"). Value, Date)

StrSchet = Nz (Rec. Fields ("Счет"). Value, "")

StrAmort = Nz (Rec. Fields ("НомерАмортГруппы"). Value, "")

NomerVnutr = Nz (Rec. Fields ("НомерВнутр"). Value, nomer)

StrDate = Nz (Rec. Fields ("ДатаАкта"). Value, Date)

StrTovar = Nz (Rec. Fields ("Товар"). Value, "")

StrInv = Nz (Rec. Fields ("ИнвКод"). Value, "")

StrStoim = Nz (Rec. Fields ("ПервСтоииость"). Value, 0)

StrSroki = Nz (Rec. Fields ("СрокИспользования"). Value, 0)

StrMethod = Nz (Rec. Fields ("СпособАморт"). Value, "")

StrMest = Nz (Rec. Fields ("Местонахождение"). Value, "")

StrKol = Nz (Rec. Fields ("Количество"). Value,

1)

StrDateIsp = Nz (Rec. Fields ("ДатаИспытания"). Value, Date)

vbSootv = Nz (Rec. Fields ("Соотвествие"). Value, True)

vbDorab = Nz (Rec. Fields ("Доработка"). Value, False)

StrSootv = Nz (Rec. Fields ("ЧтоСоотв"). Value, "")

StrDorab = Nz (Rec. Fields ("ЧтоДораб"). Value, "")

StrZakl = Nz (Rec. Fields ("Заключение"). Value, "")

StrTechDoc = Nz (Rec. Fields ("ТехДок"). Value, "")

StrPredsName = Nz (Rec. Fields ("s_preds"). Value, "")

StrPredsDolzh = Nz (Rec. Fields ("d_preds"). Value, "")

StrChl1Name = Nz (Rec. Fields ("s_4l1"). Value, "")

StrChl1Dolzh = Nz (Rec. Fields ("d_4l1"). Value, "")

StrChl2Name = Nz (Rec. Fields ("s_4l2"). Value, "")

StrChl2Dolzh = Nz (Rec. Fields ("d_4l2"). Value, "")

StrPrinName = Nz (Rec. Fields ("s_prin"). Value, "")

StrPrinDolzh = Nz (Rec. Fields ("d_prin"). Value, "")

StrPrinDate = Nz (Rec. Fields ("ДатаПринятия"). Value, Date)

StrDovFor = Nz (Rec. Fields ("ВыданаДов"). Value, "")

StrDovDate = Nz (Rec. Fields ("ДатаДов"). Value, Date)

StrDovNom = Nz (Rec. Fields ("НомерДов"). Value, "1")

StrXranName = Nz (Rec. Fields ("s_xran"). Value, "")

StrXranDolzh = Nz (Rec. Fields ("d_xran"). Value, "")

StrXranNomer = Nz (Rec. Fields ("s_nomer"). Value, "")

StrXranDate = Nz (Rec. Fields ("ДатаХранения"). Value, Date)

Else

MsgBox "Акт приемки №" & nomer & " не найден!", vbCritical + vbOKOnly

Exit Sub

End If

Set Rec = Nothing

Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrDatePodp), dbOpenSnapshot)

If Rec. RecordCount > 0 Then

StrMonthPodp = Nz (Rec. Fields ("НазвМес"). Value, "")

Else

StrMonthPodp = "нет названия"

End If

Set Rec = Nothing

Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrDateIsp), dbOpenSnapshot)

If Rec. RecordCount > 0 Then

StrMonthIsp = Nz (Rec. Fields ("НазвМес"). Value, "")

Else

StrMonthIsp = "нет названия"

End If

Set Rec = Nothing

Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrPrinDate), dbOpenSnapshot)

If Rec. RecordCount > 0 Then

StrMonthPrin = Nz (Rec. Fields ("НазвМес"). Value, "")

Else

StrMonthPrin = "нет названия"

End If

Set Rec = Nothing

Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrDovDate), dbOpenSnapshot)

If Rec. RecordCount > 0 Then

StrMonthDov = Nz (Rec. Fields ("НазвМес"). Value, "")

Else

StrMonthDov = "нет названия"

End If

Set Rec = Nothing

Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrXranDate), dbOpenSnapshot)

If Rec. RecordCount > 0 Then

StrMonthXran = Nz (Rec. Fields ("НазвМес"). Value, "")

Else

StrMonthXran = "нет названия"

End If

Set Rec = Nothing

Set oApp = CreateObject ("Excel. Application")

oApp. Workbooks. Open FileName: =StrPath, ReadOnly: =True

oApp. ActiveWorkbook. Sheets (1). Select

oApp. Cells (rRukName, cRukName). Value = StrRukName

oApp. Cells (rRukDolzh, cRukDolzh). Value = StrRukDolzh

oApp. Cells (rDatRukDay, cDatRukDay). Value = Format$ (StrDatePodp, "dd")

oApp. Cells (rDatRukMon, cDatRukMon). Value = StrMonthPodp

oApp. Cells (rDatRukYear, cDatRukYear). Value = Right$ (Format$ (StrDatePodp, "yyyy"),

1)

oApp. Cells (rFirmName, cFirmName). Value = StrFirmName

oApp. Cells (rFirmOKPO, cFirmOKPO). Value = StrFirmOKPO

oApp. Cells (rFirmAddr, cFirmAddr). Value = StrFirmAddr

oApp. Cells (rFirmReq, cFirmReq). Value = StrFirmReq

oApp. Cells (rOsn, cOsn). Value = StrOsn

oApp. Cells (rDatPriem, cDatPriem). Value = Format$ (StrDatePriem, "dd. mm. yyyy")

oApp. Cells (rSchet, cSchet). Value = StrSchet

oApp. Cells (rAmort, cAmort). Value = StrAmort

oApp. Cells (rInv, cInv). Value = StrInv

oApp. Cells (rNomer, cNomer). Value = NomerVnutr

oApp. Cells (rDat, cDat). Value = Format$ (StrDate, "dd. mm. yyyy")

oApp. Cells (rTovar, cTovar). Value = StrTovar

oApp. Cells (rMest, cMest). Value = StrMest

oApp. ActiveWorkbook. Sheets (2). Select

oApp. Cells (rPerv, cPerv). Value = StrStoim

oApp. Cells (rSrok, cSrok). Value = StrSroki

oApp. Cells (rType, cType). Value = StrMethod

oApp. Cells (rName2, cName2). Value = StrTovar

Страница:  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15 
 16  17  18  19  20  21  22  23  24  25  26  27  28  29  30 
 31  32  33  34  35  36  37  38  39  40  41  42 


Другие рефераты на тему «Программирование, компьютеры и кибернетика»:

Поиск рефератов

Последние рефераты раздела

Copyright © 2010-2024 - www.refsru.com - рефераты, курсовые и дипломные работы