【发布时间】:2019-01-20 20:14:52
【问题描述】:
我正在开发一个数据库来存储大量动物行为观察数据,并正在创建一个表单来输入数据(许多表单之一)。主表单输入一个名为"FocalSample" 的表,子表单输入一个"FocalData" 表。
This is the form at present
子表单中将有多个记录到单个总体样本,样本是 10 分钟的时间段,并且在 10 分钟内记录了单个动物的行为,并以分钟和秒为单位记录时间,以计算每种行为所花费的持续时间。
我需要弹出表单,具体取决于子表单的 "Behaviour Type" 字段中选择的内容,因为与 "social" 观察相比,"feed" 观察记录的数据类型非常不同。我为设置为"popup" 表单的不同行为类型的数据和表单创建了单独的表,但需要代码帮助才能完成我需要的操作! :P
我一直在尝试我在此处找到的以下代码的变体 (http://www.justskins.com/forums/pop-up-form-based-238440.html)
Private Sub Campaign_AfterUpdate()
Dim strFormName As String
Select Me.Campaign.Value
Case "In Honor", "In Memory"
strFormName = "HonorMemory"
Case "In-Kind"
strFormName = "InKind"
End Select
DoCmd.OpenForm strFormName, , , , , acDialog
End Sub
但我在第一行之后不断收到错误消息。 Here is the error and code screen
与我附加的其他论坛链接类似,我也需要弹出表单从主表单中提取大量信息,但我很高兴能够让弹出表单目前正常工作。
很抱歉提供了这么多细节 - 我在非洲的一个偏远地区,只能访问有限的互联网,所以我试图提前提供尽可能多的信息!
Example of popup form - you might be able to determine fields that will feed off the focalsample form Another example of a popup form - different behaviour type to the previous
编辑 我现在根据之前的响应修改了代码,但没有收到不同的错误。This is the code with the error line highlighted - I am not sure what table name to add if any Error code
【问题讨论】: