Controlling record selection on subform (1 Viewer)

Peter Peterson

New member
Local time
Today, 21:04
Joined
Sep 14, 2020
Messages
15
Hi,
I am using Office 365 Pro on the latest version of Windows.
I am very new to MS Access.
I have created a form (not bound) with a sub-form (bound datasheet).
Bigger picture is to open another form displaying client detail when a client row is double-clicked or a relevant button (command) pressed.
However, before this I am trying to achieve:
1. When the user clicks on a client row, the column is NOT selected (see Attachment v1), rather the whole row is selected (see Attachment v2);
2. The drop down menu is disabled from the column (see Attachment v3; and finally
3. Where to I find the correlating widths for the columns on the sub-form datasheet to set the text boxes widths the same (see Attachment v4)
Thanking you
Peter
 

Attachments

  • Client Browser v1.png
    Client Browser v1.png
    27.6 KB · Views: 15
  • Client Browser v2.png
    Client Browser v2.png
    24.1 KB · Views: 16
  • Client Browser v3.png
    Client Browser v3.png
    28.4 KB · Views: 14
  • Client Browser v4.png
    Client Browser v4.png
    33.3 KB · Views: 14

arnelgp

error reading drive A:
Local time
Today, 18:04
Joined
May 7, 2009
Messages
10,871
1. use conditional format.
2. ?
3. you can set the .ColumnWidth of each textbox to (1440, 1", default) or (-2 to AutoFit).
 

Peter Peterson

New member
Local time
Today, 21:04
Joined
Sep 14, 2020
Messages
15
Thank you for replying 'arnelgp',

Q1 - I managed to find "conditional formatting" thank you.
However, I would like to not display the red rectangle around the field selected.
Upon closer examination, I would also not like the column header to change to "yellow" background.
I would like the record select rectangle on the left change to "yellow" background and the four data fields highlight with blue (default) background and the column headings remain grey (refer to attached file v5, which I amended in Paint)
How do know the "name" of the control I click on in the datasheet, as if I knew that I might be able to control the background colour?
How do I change the background colour of the column headers - what is the control reference?
Q2 - solved - I wanted the default Shortcut Menu in the column header disabled. The solution was to set the Shortcut Menu in the Form (of the sub-form) to 'No'.
Q3. - I am working my through your .ColumnWidth property and have learnt about TWIPS and I believe I can resolve this - thank you.

Any further guidance with Q1 will be most welcome.
 

Attachments

  • Client Browser v5.png
    Client Browser v5.png
    31.4 KB · Views: 9

arnelgp

error reading drive A:
Local time
Today, 18:04
Joined
May 7, 2009
Messages
10,871
Q1. i don't know any Property of the datasheet that you can Control the Highlighting of the Column Header.
for conditional formatting that will Highlight the entire Row,
Delete first the CF you have right now.
add an Unbound Textbox (txtUnbound) to your datasheet Subform.
on the subform's Current event, set txtUnbound value.

private sub form_current()
me!txtUnbound = Nz(Me!SurName + Me![First Name], "@@@@")
end sub

Hide this textbox on Open event of your form:

private sub form_open(cancel as integer)
me!txtUnbound.ColumnHidden = True
end sub

select all the textbox (datasheet subform) while on design view.
on the Ribbon->Format->Conditional Format, add an "Expression Is"

Nz([Surname] + [First Name], "$$$$") = [txtUnbound]

select the Font background/foreground. Apply.

see this sample.
 

Attachments

  • subformDatasheet.zip
    32.4 KB · Views: 13
Last edited:

Users who are viewing this thread

Top Bottom