呼叫跟踪器MS访问模板 [英] Call Tracker MS Access Template

查看:54
本文介绍了呼叫跟踪器MS访问模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MS AccessCall Tracker模板,我需要一些帮助。


我在用什么:

MICROSOFT OFFICE 365

ACCESS 2016 MSO(16.0 .6965.2053)32位

在表格中通话详情我需要添加两个额外的字段(总共4个,但另外两个是简单的文本文件):在Called In By下面。我需要添加通过电话呼叫和比尔到两者都存储在客户和客户两者中。和客户扩展 tables - [Customers Extended]是组合框源的SQL。表单的来源是[Calls]。


这三个字段:[Called In By],[Call in In Phone]和[Bill To]我需要作为一个操作 - 表示选择调用者时,将自动填充其他两个字段。


我确实设法使用下面的代码预填充两个盒子,但它没有使用任何IF逻辑。我不知道在哪里放置IF逻辑 - 这里是在VBA或cbobox的SELECT语句中(如下所示)。

I''m working from MS Access "Call Tracker" template and I need some help.

What I''m Using:
MICROSOFT OFFICE 365
ACCESS 2016 MSO (16.0.6965.2053) 32-bit

On the form "Call Details" I need to add two extra fields (4 total but the other two are simple text fileds): Under "Called In By" I need to add "Called In By Phone" and "Bill To" both of which are stored in both "Customers" and "Customers Extended" tables - [Customers Extended] is the SQL for the combo box source. The source for the form is [Calls].

These three fields: [Called In By], [Called In by Phone], and [Bill To] I need to operate as one - meaning when a caller is selected the other two fields are populated automatically.

I did manage to get the two boxes pre-filled using the code below but it does not use any IF logic. I''m not sure where to put the IF logic - here in the VBA or in the SELECT statement for the cbobox (shown below).

展开 | 选择 | 换行 | 行号

推荐答案

在下面我没有使用Access来帮助格式化或测试这段代码,因此我不知道该怎么做:
Hopfully there isn''t a typo in the following as I didn''t use Access to help format or test this code, but this is representative of what I would do:
展开 | 选择 | Wrap | 行号


@jforbes


我收到编译错误(语法错误)。
@jforbes
I got a Compile error (Syntax Error).
展开 | 选择 | Wrap | 线数字


这两点都可以解决,但它们会变得有点棘手。


有一对如果当前TextBox没有值或者值与先前在ComboBox中选择的值匹配,那么第一个点的方法可以归结为仅使用ComboBox中的值。为什么这很棘手,是你的用户可以翻转并在Combobox上选择无限量或记录,并且Access中没有内置方法来跟踪所选的所有不同值。有一个.OldValue属性可以在这里工作,但我不认为它会因为.OldValue只更新保存记录而用户可以在.OldValue更新之前多次在ComboBox中选择一个值,这将使.OldValue不可靠。因此,稍微复杂一点的方法是创建一些公共变量来保存当前的ComboBox值,并在值发生变化时更新它们。然后可以参考Public变量来决定做什么。


同样,代码可能有错误,所以你可能需要调试它。如果我这样做,这将是表格的代码。注意前两行是表单级变量声明:
Both of those points can be addressed, but they are going to get a little tricky.

There are a couple approaches to your first point which boils down to only using the values from the ComboBox if the current TextBox has no value or if the Value matches what was previously selected in the ComboBox. Why this gets tricky, is that your user could flip around and select an endless amount or records on the Combobox and there isn''t a built in method in Access to track all the different Values that are selected. There is an .OldValue property that could work here, but I don''t think it will as the .OldValue only updates on the Save of a record and the User could select a value in the ComboBox multiple times before the .OldValue gets updated, which would make the .OldValue unreliable. So a slightly more complex way is to create some public variables to hold the current ComboBox values and update them when ever the value changes. Then the Public variables can be referred to, to decide on what to do.

Again, there maybe errors with the code, so you may have to debug it. This would be the code for the Form if I were to do it. Note the top two lines are Form level variable declarations:
展开 | 选择 | Wrap | 行号


这篇关于呼叫跟踪器MS访问模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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