By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,164 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,164 IT Pros & Developers. It's quick & easy.

Getting the right record

P: n/a
Hi,

I have a continuous form which shows a record on each line. Further details
are available by clicking on a box which runs code to open a further form to
give more details of the record. It works well. BUT you could well have
your cursor on one record and click on the box for extra details of another.
The result is that the details of the wrong record are displayed.

To find the right record I'm using

stLinkCriteria = "[PosId]=" & Me![PosID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

I guess I need a line of code which takes me to the relevant record where
the text box was clicked.

Any ideas?

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:c1*******************@news.demon.co.uk...
Hi,

I have a continuous form which shows a record on each line. Further details are available by clicking on a box which runs code to open a further form to give more details of the record. It works well. BUT you could well have
your cursor on one record and click on the box for extra details of another. The result is that the details of the wrong record are displayed.

To find the right record I'm using

stLinkCriteria = "[PosId]=" & Me![PosID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

I guess I need a line of code which takes me to the relevant record where
the text box was clicked.

Any ideas?

Further details are available by clicking on a box ...


What is this 'box'? If you put the code, say, in the double-click event of
a texbox on the continuous form, you could guarantee getting the right
record.
Fletcher


Nov 12 '05 #2

P: n/a
Thanks - it's a text box (I din't want a command button as i wanted a neat
colour!) Anyway, point taken - double click is fine.

In the meantime I have been seeking a solution and come up with what I think
is a rather neat one. ..... using conditional format ..... the colour of the
box changes as the form is opened .. and for some reason it has the right
data. (I guess that in the process of altering the text box the relevant
record gets the focus.)
"Fletcher Arnold" <fl****@home.com> wrote in message
news:c1**********@hercules.btinternet.com...
"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:c1*******************@news.demon.co.uk...
Hi,

I have a continuous form which shows a record on each line. Further details
are available by clicking on a box which runs code to open a further form to
give more details of the record. It works well. BUT you could well
have your cursor on one record and click on the box for extra details of

another.
The result is that the details of the wrong record are displayed.

To find the right record I'm using

stLinkCriteria = "[PosId]=" & Me![PosID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

I guess I need a line of code which takes me to the relevant record where the text box was clicked.

Any ideas?

Further details are available by clicking on a box ...


What is this 'box'? If you put the code, say, in the double-click event

of a texbox on the continuous form, you could guarantee getting the right
record.
Fletcher

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.