将多个未绑定字段保存到表时出现问题 [英] Problems Saving Multiple Unbound Fields to a Table
问题描述
我想知道是否有人可以帮助我解决问题。
我有一个包含超过50个未绑定字段的表单。
有些字段会不时出现空白。
这似乎是我遇到麻烦的地方。
我试过保留一些字段绑定当我使用保存按钮
它已保存为2个不同的记录。这是不可接受的。
这就是我所拥有的,任何人都可以帮我解决这个问题吗?
======== ========================================== ======== =====
Private Sub Command226_Click()
错误GoTo Err_Command226_Click
Dim Dbs作为数据库
Dim RstFrmAddEntry作为记录集
Dim QryFrmAddEntry作为字符串
设置Dbs = OpenDatabase(&C:\ LOCATION OF MY FILE \ File) .mdb")
QryFrmAddEntry =" Table1"
设置RstFrmAddEntry = Dbs.OpenRecordset(QryFrmAddEntry,dbOpenDynaset)
使用RstFrmAddEntry
.AddNew
!TripNumber = TripNumber.Value
!DateDispatched = DateDispatched.Value
!DateCompleted = DateCompleted.Value
!Advance = Advance.Value
!TripType = TripType.Value
!MilesPaid = MilesPaid.Value
! Origin = Origin.Value
!TripPay = TripPay.Value
!博士op1Loc = Drop1Loc.Value
!Drop1Type = Drop1Type.Value
!Drop1Rate = Drop1Rate.Value
!Drop1Miles = Drop1Miles.Value
!Drop1Pay = Drop1Pay.Value
!Drop2Loc = Drop2Loc.Value
!Drop2Type = Drop2Type.Value
!Drop2Rate = Drop2Rate.Value
!Drop2Miles = Drop2Mile.Value
!Drop2Pay = Drop2Pay.Value
!Drop3Loc = Drop3Loc.Value
!Drop3Type = Drop3Type.Value
!Drop3Rate = Drop3Rate.Value
!Drop3Miles = Drop3Miles.Value
!Drop3Pay = Drop3Pay。价值
!Drop4Loc = Drop4Loc.Value
!Drop4Type = Drop4Type.Value
!Drop4Rate = Drop4Rate.Value
!Drop4Miles = Drop4Miles.Value
!Drop4Pay = Drop4Pay.Value
!UndeckPay = UndeckPay.Value
!ReDeckPay = ReDeckPay.Value
!DelayType1 = DelayType1.Value
!DelayHrs1 = DelayHrs1.Value
!DelayPay1 = DelayPay1.Value
! DelayType 2 = DelayType2.Value
!DelayHrs2 = DelayHrs2.Value
!DelayPay2 = DelayPay2.Value
!DelayType3 = DelayType3.Value >
!DelayHrs3 = DelayHrs3.Value
!DelayPay3 = DelayPay3.Value
!LayOverRate = LayOverRate.Value
!LayoverHrs = LayoverHrs.Value
!LayoverPay = LayoverPay.Value
!OutOfRoute = OutOfRoute.Value
!OutOfRoutez = OutOfRoutez.Value
!Taxi = Taxi.Value
!Tolls = Tolls.Value
!ATM = ATM.Value
!燃料=燃料。价值
!杂项= Misc.Value
!TotalReimbursements = TotalReimbursements.Value
!Notes = Notes.Value
。更新
。关闭
结束
Err_Command226_Click:
MsgBox Err.Description < br $>
退出Sub
结束子
=============== =================================== ===========
提前感谢您的帮助。
扭矩!
Hi,
Im wondering if anyone can help me with a problem.
I have a form with more than 50 unbound fields.
Some of the fields will be blank from time to time.
This seems to be where im having trouble.
I have tried keeping some of the fields bound and when I use the save button
it has been saving as 2 different records. This is unacceptable.
This is what I have, can anyone help me out with this?
================================================== =============
Private Sub Command226_Click()
On Error GoTo Err_Command226_Click
Dim Dbs As Database
Dim RstFrmAddEntry As Recordset
Dim QryFrmAddEntry As String
Set Dbs = OpenDatabase("C:\LOCATION OF MY FILE\File.mdb")
QryFrmAddEntry = "Table1"
Set RstFrmAddEntry = Dbs.OpenRecordset(QryFrmAddEntry, dbOpenDynaset)
With RstFrmAddEntry
.AddNew
!TripNumber = TripNumber.Value
!DateDispatched = DateDispatched.Value
!DateCompleted = DateCompleted.Value
!Advance = Advance.Value
!TripType = TripType.Value
!MilesPaid = MilesPaid.Value
!Origin = Origin.Value
!TripPay = TripPay.Value
!Drop1Loc = Drop1Loc.Value
!Drop1Type = Drop1Type.Value
!Drop1Rate = Drop1Rate.Value
!Drop1Miles = Drop1Miles.Value
!Drop1Pay = Drop1Pay.Value
!Drop2Loc = Drop2Loc.Value
!Drop2Type = Drop2Type.Value
!Drop2Rate = Drop2Rate.Value
!Drop2Miles = Drop2Mile.Value
!Drop2Pay = Drop2Pay.Value
!Drop3Loc = Drop3Loc.Value
!Drop3Type = Drop3Type.Value
!Drop3Rate = Drop3Rate.Value
!Drop3Miles = Drop3Miles.Value
!Drop3Pay = Drop3Pay.Value
!Drop4Loc = Drop4Loc.Value
!Drop4Type = Drop4Type.Value
!Drop4Rate = Drop4Rate.Value
!Drop4Miles = Drop4Miles.Value
!Drop4Pay = Drop4Pay.Value
!UndeckPay = UndeckPay.Value
!ReDeckPay = ReDeckPay.Value
!DelayType1 = DelayType1.Value
!DelayHrs1 = DelayHrs1.Value
!DelayPay1 = DelayPay1.Value
!DelayType2 = DelayType2.Value
!DelayHrs2 = DelayHrs2.Value
!DelayPay2 = DelayPay2.Value
!DelayType3 = DelayType3.Value
!DelayHrs3 = DelayHrs3.Value
!DelayPay3 = DelayPay3.Value
!LayOverRate = LayOverRate.Value
!LayoverHrs = LayoverHrs.Value
!LayoverPay = LayoverPay.Value
!OutOfRoute = OutOfRoute.Value
!OutOfRoutez = OutOfRoutez.Value
!Taxi = Taxi.Value
!Tolls = Tolls.Value
!ATM = ATM.Value
!Fuel = Fuel.Value
!Misc = Misc.Value
!TotalReimbursements = TotalReimbursements.Value
!Notes = Notes.Value
.Update
.Close
End With
Err_Command226_Click:
MsgBox Err.Description
Exit Sub
End Sub
================================================== ===========
Thanks in advance for your help.
Torque!
推荐答案
痛苦愚蠢的问题,但为什么不设置必要的属性
的字段需要填写False,将表格
绑定到表格,然后用它完成?
painfully stupid question, but why not just set the Required property
of the fields that don''t need to be filled in to False, bind the form
to the table, and be done with it?
On 2006年4月15日17:54:31 -0700, pi********@hotmail.com 写道:
On 15 Apr 2006 17:54:31 -0700, pi********@hotmail.com wrote:
痛苦愚蠢的问题,但为什么不设置不需要填写False的字段的必需属性
,绑定表单<到桌子,并完成它?
painfully stupid question, but why not just set the Required property
of the fields that don''t need to be filled in to False, bind the form
to the table, and be done with it?
没有意识到有任何愚蠢的问题。
既然你似乎知道这么多,怎么用这样的方式向我解释
,我可能会理解你的智慧。
谢谢
TORQUE
Didn''t realize there were any stupid questions.
Since you seem to know so much, how about explainin this to me in such a way
that I might understand someone of your inteligence.
Thanks
TORQUE
2006年4月15日星期六21:01:03 -0400,TORQUE& LT;为了**** @ home.org>写道:
On Sat, 15 Apr 2006 21:01:03 -0400, TORQUE <To****@home.org> wrote:
2006年4月15日17:54:31 -0700, pi * *******@hotmail.com 写道:
On 15 Apr 2006 17:54:31 -0700, pi********@hotmail.com wrote:
痛苦愚蠢的问题,但为什么不设置必填属性的字段呢? 我需要填写False,将表格绑定到桌子上,并完成它吗?
painfully stupid question, but why not just set the Required property
of the fields that don''t need to be filled in to False, bind the form
to the table, and be done with it?
没有意识到有任何愚蠢的问题。
因为你似乎知道这么多,怎么用这样的方式向我解释这个我可能理解你的智慧的人。
谢谢
TORQUE
Didn''t realize there were any stupid questions.
Since you seem to know so much, how about explainin this to me in such a way
that I might understand someone of your inteligence.
Thanks
TORQUE
并非所有字段都会一直使用,有时则会被使用。
我需要的是那些字段有一些东西需要记录,而那些空白的东西要被忽视。
Not all the fields will be used all the time, and other times they will be.
What I need is for the fields that have something in them to be recorded, and the ones
that are blank to be overlooked.
这篇关于将多个未绑定字段保存到表时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!