EDIT 한 번에 하나의 레코드 만 참조 할 수 있으므로 언 바운드 폼을 사용하여 연속 폼을 사용할 수 없다는 것을 발견했습니다. 내 질문에 변경된 것을 감안할 때 ...연속 양식, 외부 연결을 사용하여 레코드를 추가/업데이트하는 방법
나는 중개자로서 테이블에 입력하기 위해 데이터를 추출하는 샘플 양식이 있습니다.
처음에는 양식이 언 바운드되어 두 개의 주 레코드 세트에 대한 연결이 열립니다. 목록 상자의 레코드 세트를 그 중 하나와 같게하고 양식 레코드 세트를 다른 레코드 세트와 같게 설정합니다.
문제는 레코드를 추가하거나 기존 레코드를 업데이트 할 수 없다는 것입니다. 필드를 잠그려고하면 마치 필드가 잠겨있는 것처럼 (실제로는 그렇지 않은 것처럼) 아무 것도하지 않습니다. 레코드 세트의 설정은 OpenKeyset 및 LockPessimistic입니다.
테이블이 연결되어 있지 않습니다.이 테이블은이 프로젝트와 별도로 외부 액세스 데이터베이스에서 가져온 것으로 이와 동일하게 유지되어야합니다. 데이터를 가져 오기 위해 adodb 연결을 사용하고 있습니다. 프로젝트에서 데이터를 분리하면이 문제가 발생할 수 있습니까? 양식
Option Compare Database
Option Explicit
Private conn As CRobbers_Connections
Private exception As CError_Trapping
Private mClient_Translations As ADODB.Recordset
Private mUnmatched_Clients As ADODB.Recordset
Private mExcluded_Clients As ADODB.Recordset
//Construction
Private Sub Form_Open(Cancel As Integer)
Set conn = New CRobbers_Connections
Set exception = New CError_Trapping
Set mClient_Translations = New ADODB.Recordset
Set mUnmatched_Clients = New ADODB.Recordset
Set mExcluded_Clients = New ADODB.Recordset
mClient_Translations.Open "SELECT * FROM Client_Translation" _
, conn.RBRS_Conn, adOpenKeyset, adLockPessimistic
mUnmatched_Clients.Open "SELECT DISTINCT(a.Client) as Client" _
& " FROM Master_Projections a " _
& " WHERE Client NOT IN (" _
& " SELECT DISTINCT ClientID " _
& " FROM Client_Translation);" _
, conn.RBRS_Conn, adOpenKeyset, adLockPessimistic
mExcluded_Clients.Open "SELECT * FROM Clients_Excluded" _
, conn.RBRS_Conn, adOpenKeyset, adLockPessimistic
End Sub
//Add new record to the client translations
Private Sub cmdAddNew_Click()
If lstUnconfirmed <> "" Then
AddRecord
End If
End Sub
Private Function AddRecord()
With mClient_Translations
.AddNew
.Fields("ClientID") = Me.lstUnconfirmed
.Fields("ClientAbbr") = Me.txtTmpShort
.Fields("ClientName") = Me.txtTmpLong
.Update
End With
UpdateRecords
End Function
Private Function UpdateRecords()
Me.lstUnconfirmed.Requery
End Function
//Load events (After construction)
Private Sub Form_Load()
Set lstUnconfirmed.Recordset = mUnmatched_Clients //Link recordset into listbox
Set Me.Recordset = mClient_Translations
End Sub
//Destruction method
Private Sub Form_Close()
Set conn = Nothing
Set exception = Nothing
Set lstUnconfirmed.Recordset = Nothing
Set Me.Recordset = Nothing
Set mUnmatched_Clients = Nothing
Set mExcluded_Clients = Nothing
Set mClient_Translations = Nothing
End Sub
Mohgeroth, 나는 당신의 질문은 매우 분명 약간의 혼란이 아니라 생각합니다. 내가 "생각하고있는 것"은 데이터 바인딩을 사용하지 않고 Access continuous forms를 어떻게 사용합니까? 그게 당신이 요구하는 것입니까? 질문을 한 문장으로 다시 구사할 수 있는지 확인하십시오. 제목을 바꿀 수 있습니다. 세스 –