Double Click Record In Form (1 Viewer)

IgnoranceIsBliss

Registered User.
Local time
Today, 01:59
Joined
Jun 13, 2019
Messages
35
I have a form set to continuous view. I was wondering if there is a way that a user can double click a specific row in the form and on the double click launch a separate form that shows all of the user_notes for the clicked record?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:59
Joined
May 7, 2009
Messages
19,234
you can do that by typing this to the double click event of each textbox:
Code:
=OpenNotes("pkFieldName", [pkFieldName])
then either create that function in the form or in a module:
Code:
Public Function OpenNotes(pkName As String, pkValue As Variant)
Dim strWhere As String
Select Case TypeName(pkValue)
Case "String" Then
    strWhere = pkName & " = '" & pkValue & "'"
Case "Integer", "Long", "Double", "Single"
    strWhere = pkName & " = " & pkValue
Case "Date"
    StrWhere = pkName & " = #" & Format(pkValue, "mm/dd/yyyy") & "#"
End Select
DoCmd.OpenForm FormName:="theFormToOpen", View:=acNormal, WhereCondition:=strWhere
End Function
I
 

IgnoranceIsBliss

Registered User.
Local time
Today, 01:59
Joined
Jun 13, 2019
Messages
35
how do I set the text box on the form that loads showing comments to be non editable?

I do not see it in the properties
 
Last edited:

IgnoranceIsBliss

Registered User.
Local time
Today, 01:59
Joined
Jun 13, 2019
Messages
35
And lastly how can I set this form to display over the current visible form? Not to display maximized?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:59
Joined
May 7, 2009
Messages
19,234
bring your form in design view.
adjust its height and width.

to make the textbox non-editable, set its Locked property to Yes.
 

IgnoranceIsBliss

Registered User.
Local time
Today, 01:59
Joined
Jun 13, 2019
Messages
35
bring your form in design view.
adjust its height and width.

to make the textbox non-editable, set its Locked property to Yes.

I had to set pop up property to Yes

When the form loads the text is highlighted. Is there a way that the text is not all highlighted when the form loads?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:59
Joined
May 7, 2009
Messages
19,234
on code to the Load Event of your form:
Code:
Private Sub Form_Load()
With Me.textbox1
    .Setfocus
    .SelStart = 0
    .Sellength = 0
End With
End Sub
 

Users who are viewing this thread

Top Bottom