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

Changing the current record when using continuous forms

P: n/a
aaj
Hi all

I have a small but rather annoying problem with continuos forms, and am
wondering if anyone can suggest a method of getting over it.

The front end is Access 2002 with the BE being SQL Server 2000.

I have a continuous bound form that is populated from a small recordset
when the form opens. The form has lots of other bits, but my problem is with
a single text box and an on-click event.

Within each record on the continuos form, a text box is bound to a field
called comments; next to each text box are a few different standard text
labels. This is repeated for each record within the recordset.

If the user clicks on the text string the text box is updated with the
relevant text string e.g.

Private Sub Label19_Click()
Me.hs_comments = "String 1"
End Sub

Private Sub Label20_Click()
Me.hs_comments = "String 2"
End Sub etc....

this works fine so long as the user has previousy clicked on the current
record to give it focus. If the user has been working on say record 1, and
then clicks on a label in record 2 hoping to update the contents of record
2, record 1 still has the focus and so its hs_comments box is updated rather
than the second records hs_comments box.

What I need to do is ensure that the record the label belongs to takes the
focus before the comments box is updated. I have tried using double click
and doevents but to no avail

any help would be most welcome

Thanks in advance

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


P: n/a
TC
Well described.

I don't have Access here to check, but I think you'll find this tough to fix
if you keep using labels.

A label can be clicked (obviously), but it does not >accept the focus<, so
the focus remains on whatever record it was on before.You need the label's
click event to move the focus to the correct new record. You can move the
focus to any record using Recordstclone, bookmarks & Selheight. But the
problem is, knowing >which record< to move it to! The label's click event
just >does not know< which record was clicked.

I can think of a few very ugly ways around this. But it would be easier to
change the labels to a control that does accept the focus: eg. a textbox.
Then, when the user clicks the text in that box, the focus will move to that
record, & everything will work ok. You could perhaps even code a MouseMove
event for the textbox, to change the cursor from the vertical text-entry bar
(which is normally displayed for a textbox), back to the normall arrow, so
it looked just like the labels did.

HTH,
TC
"aaj" <a.*@c.com> wrote in message
news:3f***********************@news.easynet.co.uk. ..
Hi all

I have a small but rather annoying problem with continuos forms, and am
wondering if anyone can suggest a method of getting over it.

The front end is Access 2002 with the BE being SQL Server 2000.

I have a continuous bound form that is populated from a small recordset
when the form opens. The form has lots of other bits, but my problem is with a single text box and an on-click event.

Within each record on the continuos form, a text box is bound to a field
called comments; next to each text box are a few different standard text
labels. This is repeated for each record within the recordset.

If the user clicks on the text string the text box is updated with the
relevant text string e.g.

Private Sub Label19_Click()
Me.hs_comments = "String 1"
End Sub

Private Sub Label20_Click()
Me.hs_comments = "String 2"
End Sub etc....

this works fine so long as the user has previousy clicked on the current
record to give it focus. If the user has been working on say record 1, and
then clicks on a label in record 2 hoping to update the contents of record 2, record 1 still has the focus and so its hs_comments box is updated rather than the second records hs_comments box.

What I need to do is ensure that the record the label belongs to takes the
focus before the comments box is updated. I have tried using double click
and doevents but to no avail

any help would be most welcome

Thanks in advance

Andy

Nov 12 '05 #2

P: n/a
aaj
That sounds like an excellent suggestion...nice lateral thought 8-)

many thanks

Andy

"TC" <a@b.c.d> wrote in message news:1069127711.695655@teuthos...
Well described.

I don't have Access here to check, but I think you'll find this tough to fix if you keep using labels.

A label can be clicked (obviously), but it does not >accept the focus<, so
the focus remains on whatever record it was on before.You need the label's
click event to move the focus to the correct new record. You can move the
focus to any record using Recordstclone, bookmarks & Selheight. But the
problem is, knowing >which record< to move it to! The label's click event
just >does not know< which record was clicked.

I can think of a few very ugly ways around this. But it would be easier to
change the labels to a control that does accept the focus: eg. a textbox.
Then, when the user clicks the text in that box, the focus will move to that record, & everything will work ok. You could perhaps even code a MouseMove
event for the textbox, to change the cursor from the vertical text-entry bar (which is normally displayed for a textbox), back to the normall arrow, so
it looked just like the labels did.

HTH,
TC
"aaj" <a.*@c.com> wrote in message
news:3f***********************@news.easynet.co.uk. ..
Hi all

I have a small but rather annoying problem with continuos forms, and am
wondering if anyone can suggest a method of getting over it.

The front end is Access 2002 with the BE being SQL Server 2000.

I have a continuous bound form that is populated from a small recordset
when the form opens. The form has lots of other bits, but my problem is

with
a single text box and an on-click event.

Within each record on the continuos form, a text box is bound to a field
called comments; next to each text box are a few different standard text
labels. This is repeated for each record within the recordset.

If the user clicks on the text string the text box is updated with the
relevant text string e.g.

Private Sub Label19_Click()
Me.hs_comments = "String 1"
End Sub

Private Sub Label20_Click()
Me.hs_comments = "String 2"
End Sub etc....

this works fine so long as the user has previousy clicked on the current
record to give it focus. If the user has been working on say record 1, and then clicks on a label in record 2 hoping to update the contents of

record
2, record 1 still has the focus and so its hs_comments box is updated

rather
than the second records hs_comments box.

What I need to do is ensure that the record the label belongs to takes the focus before the comments box is updated. I have tried using double click and doevents but to no avail

any help would be most welcome

Thanks in advance

Andy


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.