扩展调查表格的评估性陈述 [英] Expanding an evaluative statement for a survey entry form
问题描述
我们从客户处输入调查时使用控件#。 控制号由一个朱利安日期(180表示一年中的一天),然后是路由#(4位),最后是一个序号#(3位数)我几年前编写的代码,认为重复的机会是
会很渺茫,但现在发现苗条已经到了城里。
We use a control # when entering surveys back from our customers. The control number consist of a julian date (180 means day of year), then a routing # (4 digits) and finally a seq # (3 digits) I wrote the code a few years ago thinking the chances of duplication would be slim to none, but now find out that slim has come to town.
Private Sub SBOL ___ BeforeUpdate(取消为整数)
Dim SID As String
Dim stLinkCriteria As String
SID =我。[SBOL#]。价值
stLinkCriteria =" [SBOL#] =" &安培; """ &安培; SID& "'"
Dim rsc As DAO.Recordset
设置rsc = Me.RecordsetClone
如果DCount("[SBOL#]","tblSurveyRsp",_
stLinkCriteria)> 0然后
Me.Undo
'消息框重复警告
MsgBox"警告调查追踪号码" _
&安培; SID& "已进入。" _
&安培; vbCr& vbCr& "现在,您将被带到记录" ;, _
             &NBSP ; vbInformation,"重复信息"
'转到原始调查记录
rsc.FindLast stLinkCriteria
Me.Bookmark = rsc.Bookmark
设置rsc = Nothing
结束如果
Private Sub SBOL___BeforeUpdate(Cancel As Integer)
Dim SID As String
Dim stLinkCriteria As String
SID = Me.[SBOL #].Value
stLinkCriteria = "[SBOL #]=" & "'" & SID & "'"
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
If DCount("[SBOL #]", "tblSurveyRsp", _
stLinkCriteria) > 0 Then
Me.Undo
'Message box warning of duplication
MsgBox "Warning Survey Tracking Number " _
& SID & " has already been entered." _
& vbCr & vbCr & "You will now been taken to the record.", _
vbInformation, "Duplicate Information"
'Go to record of original Survey
rsc.FindLast stLinkCriteria
Me.Bookmark = rsc.Bookmark
Set rsc = Nothing
End If
首先,这是在控制#输入框(SBOL)中更新之前。
First off this is before update in the control # entry box (SBOL).
如果去年锁定了相同的控制号,然后它会显示重复的消息警告,然后将表单恢复为该重新编号以进行修改。
If the same control number was keyed last year, then it will bring up the duplicate message warning and then revert the form to that recorn number for modification.
实际上,这是一项需要键入的新调查。
In reality, this is a new survey that needs to be keyed.
对于我的生活,我无法想出一个解决方法。
For the life of me, I cant come up with a fix for this.
还有另一个表,其中[SBOL#]记录了创建日期,我试图做一个dlookup并引用它以确定它是否在过去的60天内但我无法在IF语句中使用它。 我打算将另一个IF语句
放在这个以上,看看日期是否先通过,但它一直告诉我我取消了这个事件。
There is another table where the [SBOL #] has its create date logged and I tried to do a dlookup and reference that to determine if it is within the last 60 days but I cant get it to work with in the IF statement. I was going to put another IF statement above this one to see if the date passes first, but it keeps telling me I cancelled the event.
任何想法?
谢谢
推荐答案
这不是VB6论坛,正如本论坛顶部所说的VB6
This is not a VB6 forum as is stated in top of this forum for VB6
<跨度风格="颜色:#333333;字体家庭: '的Segoe UI', '很好的可读性',宋体,Arial字体,黑体,无衬线;字体大小:13像素; line-height:16px">
MSDN现在为VB6提供本地支持选项。 这可以在MSDN横幅的非常顶部的选项卡中看到,该选项卡位于您当前正在查看的论坛选项卡旁边。 资源中心位于:
MSDN now offers a local support option for VB6. This can be seen in the tabs at the VERY TOP of the MSDN banner, next to the the Forum tab, which you are currently viewing. The resource center is located at:
http://msdn.microsoft.com/en-us/vbasic/ms788229.aspx
-
Visual
Basic Interop and Upgrade (将VB6代码更新为.NET) -
Visual
Basic General (一般VB.NET问题) -
Visual
Basic Power Packs (作为VB Power Pack一部分的控件,组件,示例和工具)
-
Visual
Basic Language (VB.NET语言 - 编译器,运行时,语言关键字)
-
Visual
Basic IDE (IntelliSense,调试,错误更正,代码片段,着色,智能标签等)
- Visual Basic Interop and Upgrade (Update VB6 code to .NET)
- Visual Basic General (General VB.NET questions)
- Visual Basic Power Packs (controls, components, samples and tools that are part of the VB Power Packs)
- Visual Basic Language (VB.NET language -- compiler, runtime, language keywords)
- Visual Basic IDE (IntelliSense, debugging, ErrorCorrect, code snippets, colorization, smart tags, etc.)
-
Essential
VB 6开发人员培训视频 -
Visual
MSDN Library上的基本6.0 -
MSDN
Visual Basic 6.0资源中心 -
VB-Helper
-
CodeGuru
-
代码
项目 -
Planet
源代码
- Essential Training Videos for VB 6 developers
- Visual Basic 6.0 on MSDN Library
- MSDN Visual Basic 6.0 Resource Center
- VB-Helper
- CodeGuru
- Code Project
- Planet Source Code
这篇关于扩展调查表格的评估性陈述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!