帮助错误2448:您无法为此对象指定值 [英] Help with error 2448: You can't assign value to this object

查看:111
本文介绍了帮助错误2448:您无法为此对象指定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要有关错误2448的帮助:您无法为此对象指定值。我想要做的是允许用户从组合选项中选择事件ID和种族ID。一旦用户选择了那些,那么假设与那些相关联的id被转移到新表格,该表格应该将这两个id与来自跑步者表的跑步者id相关联。因此,我将在event-race-runner表中使用所有三个id(这是一个关联表)。但是,当我这样做时,我收到错误消息,不允许我将ID插入此新表。我已附上以下代码。所有id都是数字。主表id是自动生成的。


这是应携带id的代码:

Private Sub cmdAddRaceRunner_Click()

DoCmd.OpenFormRace Runner for race,,,, acFormAdd ,, OpenArgs:= cmbErEventid& " |" &安培; cmbErRaceid

end sub


这是应该将id分配到新表中的表格:

展开 | 选择 | Wrap | 行号

解决方案

嗨僵尸 -


作为备注供将来参考,请在发布时使用代码标签VBA ......


你能指出错误发生在哪一行吗?您可以通过在代码中设置断点然后使用F8按钮逐行逐步执行此操作来执行此操作,直到错误被触发为止。


查看代码,我看到一个错误的可能性,但我想首先确认,在我指出它之前,Access正在停止。


Pat


| 的唯一目的是什么?在你的代码中?


欢迎来到 Bytes


Linq ; 0)>


这是一种更简单的方法来做你正在做的事情。 http://www.baldyweb.com/OpenArgs.htm

I need help with error 2448: You can''t assign value to this object. What I am trying to do is allow user to select event id and race id from combo option. Once the user selects those, then the id associated with those is suppose to be carried over to a new form which should associated those two ids with runner id from runner table. Thus, I will have all three ids in event-race-runner table (which is an associative table). However when I do that I get the error message which does not let me insert the ids into this new table. I have attached the codes below. All id are number. The main table ids were generated automatically.

This is the code which should carry the ids:
Private Sub cmdAddRaceRunner_Click()
DoCmd.OpenForm "Input Runner for race", , , , acFormAdd, , OpenArgs:=cmbErEventid & "|" & cmbErRaceid
end sub

this is the form which should have assigned the id into the new table:

Expand|Select|Wrap|Line Numbers

解决方案

Hi zombie -

Just as a note for future reference, please use code tags when posting VBA...

Can you indicate what line the error is happening on? You can do this by setting a breakpoint in the code and then stepping through it line by line using the F8 button, until the error gets triggered.

Looking at your code, I see one possibility for the error, but I''d like to confirm first that it''s where Access is stopping before I point it out.

Pat


What exactly is the purporse of the "|" in your code?

Welcome to Bytes!

Linq ;0)>


Here is a simpler way to do what you are doing. http://www.baldyweb.com/OpenArgs.htm


这篇关于帮助错误2448:您无法为此对象指定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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