Does a join query lock both sides of join, or just the side w/field being edited? (1 Viewer)

cnstarz

Registered User.
Local time
Today, 16:02
Joined
Mar 7, 2013
Messages
89
I've run into a problem with memo fields locking out the record and preventing saves, so I've decided to just place all memo fields from each table into their own tables. For example, all the memo fields for tbl_Effects are now in tbl_Effects_Memo.

My question is, if I were to make the recordsource of frm_Effect a query that joins tbl_Effects to tbl_Effects_Memo, will editing the memo field place a lock on both sides of the join, or will it just place a lock on the tbl_Effects_Memo side? I'm hoping to do it this way instead of creating individual child subforms for each memo field on frm_Effect.
 

Minty

AWF VIP
Local time
Today, 21:02
Joined
Jul 26, 2013
Messages
10,355
You may have been better to lock the memo display controls on you form, and have a separate modal Pop up form to make the edits to the memo fields. This way they aren't being locked simply by someone in them, although I'm not sure why you would have had an issue just with the memo fields.
 

cnstarz

Registered User.
Local time
Today, 16:02
Joined
Mar 7, 2013
Messages
89
Just played with a test query and, sure enough, turns out editing a tlb_Effects_Memo field locks records on both sides of the query -- even if there are no fields from tbl_Effects in the query.

Currently, I have a custom zoombox that opens when you double-click on a field:

Code:
Private Sub txt_MemoField_DblClick(Cancel As Integer)[INDENT]Call Zoombox (me.txt_MemoField)
[/INDENT]End Sub
Zoombox looks like this:

Code:
Option Compare Database
Option Explicit
Public g_ctl as Control

Public Sub Zoombox(ByRef ctl as Control)[INDENT]Dim frm as Form

Set frm = New Form__Zoombox
Set g_ctl = ctl

frm.txt_Text = g_ctl.Text
frm.Visible = True

clnWindow.Add item:=frm, Key:=Cstr(frm.hWnd)
set frm = nothing
[/INDENT]End Sub
Closing the Zoombox Form:

Code:
Private Sub cmd_Cancel_Click()[INDENT]Set g_ctl = Nothing
Call Form_Close
[/INDENT]End Sub
-------------------------------------------
Private Sub cmd_Okay_Click()[INDENT]g_ctl = Me.txt_Text
Set g_ctl = nothing
Call Form_Close
[/INDENT]End Sub
-------------------------------------------
Private Sub Form_Close()[INDENT]Set g_ctl = nothing
CloseClnWindow(Me.hWnd)
[/INDENT]End Sub

Edit: Changing the "Unique Fields" (DistinctRow) property of the query to "Yes" locks only the side of the join that the edited field is part of.
 
Last edited:

Users who are viewing this thread

Top Bottom