{已解决}以另一种形式转到“选定记录”。 [英] {SOLVED} Go to Selected Record in a another form.

查看:69
本文介绍了{已解决}以另一种形式转到“选定记录”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个cmd按钮" Details"在列出所有可用记录的表格上;如何将其指向选定的记录而不是仅仅打开一个表单?

下面是打开我目前为止的表单的代码。谢谢你的帮助!

maili

============================ ====

Private Sub cmdDetails_Click()

On Error GoTo Err_cmdDetails_Click


Dim stDocName As String

Dim stLinkCriteria As String


stDocName =" PromosMainForm"

stLinkCriteria =" [PromoCode] =" &安培;我![PromoCode]

DoCmd.OpenForm stDocName ,, stLinkCriteria


Exit_cmdDetails_Click:

退出子


Err_cmdDetails_Click:

MsgBox Err.Description

恢复Exit_cmdDetails_Click


结束Sub

Hi All,
I have a cmd button "Details" on a form listing all available records; how do I direct it to the selected record rather than just open a form?
Below is the code for Open the form I have so far. Thanks for the help!
maili
================================
Private Sub cmdDetails_Click()
On Error GoTo Err_cmdDetails_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PromosMainForm"

stLinkCriteria = "[PromoCode]=" & Me![PromoCode]
DoCmd.OpenForm stDocName, , stLinkCriteria

Exit_cmdDetails_Click:
Exit Sub

Err_cmdDetails_Click:
MsgBox Err.Description
Resume Exit_cmdDetails_Click

End Sub

推荐答案

不确定你的意思,给定一个PromoCode,你想找到当前形式的记录吗?


如果这就是你的意思然后你可以使用recordsetclone和书签

例如

Not sure what u mean here, given a PromoCode, u want to find that record in the current form?

if thats what u mean then u could use recordsetclone and bookmarks
e.g.

展开 | 选择 | Wrap | L ine Numbers


谢谢,我会试试。

maili
Thanks, I will try it.
maili


我有一个类似的问题。我正在为朋友编写一个联系人管理数据库,我遇到的问题之一就是上面描述的问题。


我已经在我编写的另一个Prospecting数据库中成功完成了这个操作。在该数据库中,我使用宏来OpenForm,条件设置为[ID] = [Forms]![ID]。


这可以在两个不同的探矿形式之间切换,这些探测形式从不同的查询中生成,这些查询命中了相同的两个表格。


我尝试使用相同的语法从主表单(引用主表中的所有字段)到辅助表单(仅引用第二个表中的字段)时的联系人管理数据库。


链接在两个表之间是查找列。从辅助表中提取代理的名字和姓氏。


我想在主窗体中使用此查找列条目打开绑定到辅助数据库的辅助表单并选择从中选择查找列条目的整个记录​​。我尝试了在其他数据库中工作的相同语法,但是当我运行宏访问时弹出一个输入框,询问包含查找列值的表单字段的内容。


1.是否可以以这种方式将查找列中的值用作表到表链接?

2.正确的语法是什么要做到这一点吗?


我的SQL技能非常生疏,所以我尽可能使用wizars。


谢谢

dave
I''m having a similar problem. I am programing a Contact Management database for a friend and one of the problems I am encountering is the one described above.

I have successfully accomplished this operation in another Prospecting database I have written. In that database I use a macro to OpenForm with the Condition set to [ID]=[Forms]![ID].

This switches between two different prospecting forms generating from different Queries which hit the same two Tables.

I tried to use the same syntax in the Contact Management database when going from the Main Form, which references all the fields in the main Table, to a secondary Form, which references only the fields in a second Table.

The link between the two tables is a "Lookup Column" which pulls the first and last names of agents from the secondary table.

I want to use this Lookup Column entry in the Main form to open a secondary form bound to the secondary database and selecting the entire record from which the Lookup Column entry was selected. I have tried the same syntax that worked in the other database but when I run the macro access pops up an entry box asking for the contents of the form field which contains the Lookup Column value.

1. Is it possible to use the value in a Lookup Column as a table to table link in this fashion?
2. What is the proper syntax to accomplish this?

My SQL skills are very rusty so I am using the wizars where ever possible.

thanks
dave


这篇关于{已解决}以另一种形式转到“选定记录”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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