How to highlight individual records on a continuous form

O

OssieMac

I have a continuous form which generates a list of records containing blank
fields that still need to be completed by the user.

The user Double Clicks the Product Id on the continuous form and the record
Product Id is copied to the Product Details (editing form) and the record is
found and displayed for the user to complete the blank fields. (Relatively
simple code posted below)

It all works fine but with one problem. The users keep loosing their place
on the continuous form resulting in wasted time locating the next record,
selecting a record already fixed or even skipping a record altogether.

What I would like to do is highlight each record as it is double clicked. (I
don’t care whether it is Bold, Font color or background color. I cannot find
any way of doing this because it changes the format for the entire column on
the continuous form.

It will be greatly appreciated if anyone can help me with a solution?
Alternatively, if the experts believe that it can't be done then please
answer accordingly because that will be appreciated also because at least I
then know to stop wasting time on it.

Private Sub Product_Id_DblClick(Cancel As Integer)

Dim tempProdId As Long

tempProdId = Me.Product_Id
DoCmd.OpenForm "Product Details"

'Assign the ProdId which was double clicked to the
'ProductNumber field on Product Details form.
Forms![Product Details].ProductNumber = tempProdId
Forms![Product Details].ProductNumber.SetFocus

'Call the event in Product Details which in turn
'calls the find routine in Product Details
Forms![Product Details].ProductNumber_AfterUpdate

End Sub
 
O

OssieMac

A million thanks Alex. Works perfectly.

Just for anyone else who might look this up for assistance. I added a field
that I called CurrentEdit to the header of the form and in the Double Click
Event I inserted the line:-
Me.CurrentEdit = Me.Product_Id.
In Conditional Format I used:-
Expression is [Product_Id] = [CurrentEdit].

--
Regards,

OssieMac


Alex Dybenko said:
Hi,
try to use conditional formatting, you can add some field which you will
update when use double-click, then base your condition on this new field

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


OssieMac said:
I have a continuous form which generates a list of records containing blank
fields that still need to be completed by the user.

The user Double Clicks the Product Id on the continuous form and the
record
Product Id is copied to the Product Details (editing form) and the record
is
found and displayed for the user to complete the blank fields. (Relatively
simple code posted below)

It all works fine but with one problem. The users keep loosing their place
on the continuous form resulting in wasted time locating the next record,
selecting a record already fixed or even skipping a record altogether.

What I would like to do is highlight each record as it is double clicked.
(I
don’t care whether it is Bold, Font color or background color. I cannot
find
any way of doing this because it changes the format for the entire column
on
the continuous form.

It will be greatly appreciated if anyone can help me with a solution?
Alternatively, if the experts believe that it can't be done then please
answer accordingly because that will be appreciated also because at least
I
then know to stop wasting time on it.

Private Sub Product_Id_DblClick(Cancel As Integer)

Dim tempProdId As Long

tempProdId = Me.Product_Id
DoCmd.OpenForm "Product Details"

'Assign the ProdId which was double clicked to the
'ProductNumber field on Product Details form.
Forms![Product Details].ProductNumber = tempProdId
Forms![Product Details].ProductNumber.SetFocus

'Call the event in Product Details which in turn
'calls the find routine in Product Details
Forms![Product Details].ProductNumber_AfterUpdate

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top