Highligh Row in datasheet (1 Viewer)

Gismo

Registered User.
Local time
Today, 17:49
Joined
Jun 12, 2017
Messages
1,298
Hi all, I think I asked this question before but I can not find the post. I have a few form which utilizes a datasheet and a single subform. I need the record that is selected in the datasheet to highlight the row to indicate which data is displayed in the single subform. who do I do this please
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:49
Joined
May 7, 2009
Messages
19,233
What do you mean highlight the row. Soes the datasheet and subform in same doem?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:49
Joined
May 7, 2009
Messages
19,233
What do you mean highlight the row. Does the datasheet and subform in same form?
 

Gismo

Registered User.
Local time
Today, 17:49
Joined
Jun 12, 2017
Messages
1,298
yes the datasheet and the single subform is in the same form. you select a record in the data sheet and relevant info is displayed in the single form below. when record is selected in datasheet, the row must be highlighted to indicate which record is in focus. At this point in time only the one field in the record is highlighted but I need it to maybe invert the colour, font to white and background to black
 

Gismo

Registered User.
Local time
Today, 17:49
Joined
Jun 12, 2017
Messages
1,298
Tnx Minty, let me go through it, will let you know the outcome
 

Gismo

Registered User.
Local time
Today, 17:49
Joined
Jun 12, 2017
Messages
1,298
I gen an error on Function GetLineNumber()
I have my control in place
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:49
Joined
May 7, 2009
Messages
19,233
you can also use Conditional Formatting on your Subform.
select all fields in your subform, on the Ribbon->Format->Conditional Formatting.
Choose New Rule. from the First Combobox, choose Expression Is.
Type on the textbox: [Forms]![yourMainFormName]![FieldInYourMainForm] = [FieldInYourSubform]

then change to background color or the text color.
done.
 

isladogs

MVP / VIP
Local time
Today, 15:49
Joined
Jan 14, 2017
Messages
18,209
Hi all, I think I asked this question before but I can not find the post.

Gismo

for future reference, this page shows a list of all the threads you have started

https://www.access-programmers.co.uk/forums/search.php?searchid=11993873

To get to this, click on:
User CP => Your Profile => Statistics => Find All Threads Started by ...

You can also get to this for other users by clicking on their user name to the left of a post
 

isladogs

MVP / VIP
Local time
Today, 15:49
Joined
Jan 14, 2017
Messages
18,209
@arnelgp

I've tried doing exactly what you have suggested in the past and it didn't work.

I tried it again after reading your post
This highlights the first row in the datasheet / continuous form but the same row stays highlighted when you move through the records

Please could you post a simple example of a form / subform using CF to highlight the selected row in a datasheet
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:49
Joined
May 7, 2009
Messages
19,233
Please find the attached.
 

Attachments

  • sampleHighlight.zip
    32.5 KB · Views: 429

isladogs

MVP / VIP
Local time
Today, 15:49
Joined
Jan 14, 2017
Messages
18,209
Hi arne

I can see how you've done that and agree that it works. Well done

However, not quite as simple as you originally described it .....
i.e. adding a dummy field and requerying using Form_Current event

Now you can really impress me if you wish... :eek:

Attached is the emulated split form example from sample databases
I've added your method to highlight the selected row

See if you can get it to work just using CF WITHOUT adding the dummy field

I look forward to your reply! :rolleyes:
 

Attachments

  • EmulateSplitForm v2.accdb
    860 KB · Views: 250

isladogs

MVP / VIP
Local time
Today, 15:49
Joined
Jan 14, 2017
Messages
18,209
arnelgp,

Any chance of a 2007 version please?

Arne is offline
My last post uses his approach.
It was done in Access 2010 so it should work for you.
You'll recognise it as you've downloaded it before (with no CF)
 

isladogs

MVP / VIP
Local time
Today, 15:49
Joined
Jan 14, 2017
Messages
18,209
Arneglp posted his solution to my challenge in another thread
https://www.access-programmers.co.uk/forums/showthread.php?t=40081

Very clever it is as well...well done to Arneglp

I added a further challenge to also highlight the section with a checkbox
However, I've solved that myself - see screenshot



EDIT:
I have also posted this updated version in the same sample databases thread it originally came from
Emulating the split form
 

Attachments

  • Capture.PNG
    Capture.PNG
    26.5 KB · Views: 2,484
  • EmulateSplitForm v3.accdb
    544 KB · Views: 357
Last edited:

Users who are viewing this thread

Top Bottom