本文介绍了sql并通过open args传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在找出我需要做的事情时遇到了麻烦。基本上,我想要从几个不同的表中提取数据并使用open args将它们发送到表格

。但是,正在馈送的表单需要连接某些数据列。这是我到目前为止的代码。

我确定它不对,因为它无法正常工作。


私人Sub cmdEdit_Click()

Dim sSQL As String


sSQL =" Select RENTAL。[RID],RENTAL。[EVENTID],EVENT。[NAME] " &安培; _

" EVENT。[FILENUMBER],租赁。[RENTALDATE],RENTALITEM。[RENTALID]" &

_

"出租。[RENTALITEM],租赁。[RENTALTYPE]," &安培; _

" RENTALITEM。[PRICEPERUNIT],租赁。[QUANTITY]" &安培; _

"来自RENTALITEM &安培; _

" WHERE表格![frmRentalSearch]。[RID] =出租。[RID]"

DoCmd.OpenForm" frmEditRental",acNormal,OpenArgs:= sSQL

End Sub


感谢您的帮助。


Fred

I''m having trouble figuring out what I need to do here. Basically, I
want to pull data from several different tables and send them to a form
using open args. However, the form that is being fed need to have
certain columns of data concatenated. Here is the code I have so far.
I''m sure it''s not right because it doesn''t work right.

Private Sub cmdEdit_Click()
Dim sSQL As String

sSQL = "Select RENTAL.[RID], RENTAL.[EVENTID], EVENT.[NAME]" & _
" EVENT.[FILENUMBER], RENTAL.[RENTALDATE], RENTALITEM.[RENTALID]" &
_
" RENTAL.[RENTALITEM], RENTAL.[RENTALTYPE]," & _
" RENTALITEM.[PRICEPERUNIT], RENTAL.[QUANTITY]" & _
" FROM RENTALITEM " & _
"WHERE forms![frmRentalSearch].[RID] = RENTAL.[RID]"
DoCmd.OpenForm "frmEditRental", acNormal, OpenArgs:=sSQL
End Sub

Thanks for any help.

Fred

推荐答案




这篇关于sql并通过open args传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 16:12