更新表字段 [英] Update Table Fields

查看:108
本文介绍了更新表字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要实现的是一个  CurrentDb.Execute" UPDATE tblOwnerInfo

What I am trying to achieve is a  CurrentDb.Execute "UPDATE tblOwnerInfo

所以当我点击我的控制所有所有者ID是"活跃"时将更新到tblOwnerInfo中的字段

So when I click on my Control All OwnerID's that are "Active" Will Update to there fields in tblOwnerInfo

目前这在我的表单上工作正常,我选择一个OwnerID,所有正确的总和都在我表单上的那些文本框中。但是没有更新到我的桌子,如果有人可以帮助我,这将是伟大的。会费在一个模块

At present this is working fine on my form which I select one OwnerID and all correct sums are in those text boxes on my form. But are not updated to my table, If anyone could help me this would be great. Dues is in a module

谢谢......... Bob

Thanks .........Bob

tblOwnerInfo.OwnerID,Number

tblOwnerInfo.Total,Currency

tblOwnerInfo.Current,Currency

tblOwnerInfo.1Month,Currency

tblOwnerInfo.2Month,货币

tblOwnerInfo.3Month,货币

tblOwnerInfo.Status,Text  [活动,完成]

tblOwnerInfo.OwnerID,Number
tblOwnerInfo.Total,Currency
tblOwnerInfo.Current,Currency
tblOwnerInfo.1Month,Currency
tblOwnerInfo.2Month,Currency
tblOwnerInfo.3Month,Currency
tblOwnerInfo.Status,Text  [Active,Finish]

[tb3Month] =格式(Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],3),"#,## 0.00 ;(#,## 0.00)")

[tb2Month] =格式(Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],2),"#, ## 0.00;(#,## 0.00)")

[tb1Month] =格式(Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],1)," ;#,## 0.00;(#,## 0.00)")

[tbCurrent] =格式(Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],0 ),"#,## 0.00;(#,## 0.00)")

[tb3Month]=Format(Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],3),"#,##0.00;(#,##0.00)")
[tb2Month]=Format(Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],2),"#,##0.00;(#,##0.00)")
[tb1Month]=Format(Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],1),"#,##0.00;(#,##0.00)")
[tbCurrent]=Format(Dues([tb3Months0],[tb2Months0],[tb1Month0],[tbCurrent0],0),"#,##0.00;(#,##0.00)")

[tb3Months] =格式(nz(" Dues"," qOverDue" ,"MD = 3",0),"$#,## 0.00;($#,## 0.00)")

[tb2Months0] =格式(nz(DLookUp( "Dues","qOverDue","MD = 2",0),"$#,## 0.00;($#,## 0.00)")

[ tb1Month0] =格式(NZ(使用DLookup(QUOT;会费"," qOverDue"," MD等于1英寸;),0)," $#,## 0.00;($#,## 0.00)")

[tbCurrent] =格式(nz(DLookUp("Dues","qOverDue","MD = 0"), 0),"$#,## 0.00;($#,## 0.00)")

[tb3Months]=Format(nz(DLookUp("Dues","qOverDue","MD=3"),0),"$#,##0.00;($#,##0.00)")
[tb2Months0]=Format(nz(DLookUp("Dues","qOverDue","MD=2"),0),"$#,##0.00;($#,##0.00)")
[tb1Month0]=Format(nz(DLookUp("Dues","qOverDue","MD=1"),0),"$#,##0.00;($#,##0.00)")
[tbCurrent]=Format(nz(DLookUp("Dues","qOverDue","MD=0"),0),"$#,##0.00;($#,##0.00)")

qOverdue

MD:IIf(qOwnerPercentAmountInPaymentMethodAll.AmountSummary< ; 0,3,IIF(MonthsDue([OnDate])> = 3,3,IIF(MonthsDue([OnDate])> = 2,2,IIF(MonthsDue([OnDate])> = 1,1, 0))))

qOverdue
MD: IIf(qOwnerPercentAmountInPaymentMethodAll.AmountSummary<0,3,IIf(MonthsDue([OnDate])>=3,3,IIf(MonthsDue([OnDate])>=2,2,IIf(MonthsDue([OnDate])>=1,1,0))))

推荐答案

我在连续表单上有未绑定的5个文本框,现在我正在努力将它们更新到我的每个OwnerID表,我需要这样的代码如下...........感谢任何帮助....... Bob

Sub subSetTotals()

I have my unbound 5 text boxes on a continuous form , now I am struggling to update them to each OwnerID in my table, I need something like this code below...........Thanks For any help.......Bob

Sub subSetTotals()

 

  

Dim recTotal As DAO.Recordset

 
  
Dim recTotal As DAO.Recordset

   设置recTotal = CurrentDb.OpenRecordset(" select * from tblOwnerInfo,其中OwnerID =& tbOwnerID)

    

   使用recTotal

     

            .Fields(" Current")= tbCurrent.value

            .Fields(" 1Month")= tb1Month.value

             .Fields(" 2Month")= tb2Months.value

              .Fields(" 3Month")= tb3Months.value

      

 

   结束

    Set recTotal = CurrentDb.OpenRecordset("Select * from tblOwnerInfo where OwnerID=" & tbOwnerID)
    
    With recTotal
     
            .Fields("Current") = tbCurrent.value
            .Fields("1Month") = tb1Month.value
             .Fields("2Month") = tb2Months.value
              .Fields("3Month") = tb3Months.value
      
 
    End With

结束子


这篇关于更新表字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆